aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/pidfd/pidfd_setns_test.c
diff options
context:
space:
mode:
authorLinus Torvalds <[email protected]>2024-05-21 14:34:43 +0200
committerLinus Torvalds <[email protected]>2024-05-21 08:08:00 -0700
commitdb3d841ac9edb0b98cc002e3b27c0b266ecfe5ba (patch)
treeb3b9525c373629399e55b4a1df429658326a651b /tools/testing/selftests/pidfd/pidfd_setns_test.c
parent8f6a15f095a63a83b096d9b29aaff4f0fbe6f6e6 (diff)
fs/pidfs: make 'lsof' happy with our inode changes
pidfs started using much saner inodes in commit b28ddcc32d8f ("pidfs: convert to path_from_stashed() helper"), but that exposed the fact that lsof had some knowledge of just how odd our old anon_inode usage was. For example, legacy anon_inodes hadn't even initialized the inode type in the inode mode, so everything had a type of zero. So sane tools like 'stat' would report these files as "weird file", but 'lsof' instead used that (together with the name of the link in proc) to notice that it's an anonymous inode, and used it to detect pidfd files. Let's keep our internal new sane inode model, but mask the file type bits at 'stat()' time in the getattr() function we already have, and by making the dentry name match what lsof expects too. This keeps our internal models sane, but should make user space see the same old odd behavior. Reported-by: Jiri Slaby <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Link: https://github.com/lsof-org/lsof/issues/317 Cc: Alexander Viro <[email protected]> Cc: Seth Forshee <[email protected]> Cc: Tycho Andersen <[email protected]> Signed-off-by: Christian Brauner <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/testing/selftests/pidfd/pidfd_setns_test.c')
0 files changed, 0 insertions, 0 deletions