summaryrefslogtreecommitdiffstats
path: root/mm/backing-dev.c
diff options
context:
space:
mode:
authorAmir Goldstein2018-06-08 02:07:15 +0200
committerLinus Torvalds2018-06-08 02:34:36 +0200
commit12ba780d64f6c96d40de9c4d1468fb732e64be4c (patch)
treee2761c1591c03a7268632f05c04e07568b01e58c /mm/backing-dev.c
parentmm/ksm: move [set_]page_stable_node from ksm.h to ksm.c (diff)
downloadkernel-qcow2-linux-12ba780d64f6c96d40de9c4d1468fb732e64be4c.tar.gz
kernel-qcow2-linux-12ba780d64f6c96d40de9c4d1468fb732e64be4c.tar.xz
kernel-qcow2-linux-12ba780d64f6c96d40de9c4d1468fb732e64be4c.zip
tmpfs: allow decoding a file handle of an unlinked file
tmpfs uses the helper d_find_alias() to find a dentry from a decoded inode, but d_find_alias() skips unhashed dentries, so unlinked files cannot be decoded from a file handle. This can be reproduced using xfstests test program open_by_handle: $ open_by handle -c /tmp/testdir $ open_by_handle -dk /tmp/testdir open_by_handle(/tmp/testdir/file000000) returned 116 incorrectly on an unlinked open file! To fix this, if d_find_alias() can't find a hashed alias, call d_find_any_alias() to return an unhashed one. Link: http://lkml.kernel.org/r/CAOQ4uxg+qSLP0KwdW+h1tcPqOCQd+_pGZVXiePQB1TXCMBMctQ@mail.gmail.com Signed-off-by: Amir Goldstein <amir73il@gmail.com> Reviewed-by: NeilBrown <neilb@suse.com> Cc: Hugh Dickins <hughd@google.com> Cc: Jeff Layton <jlayton@poochiereds.net> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/backing-dev.c')
0 files changed, 0 insertions, 0 deletions