Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

proc_fd_getattr(): don't bother with S_ISDIR() check

that thing is callable only as ->i_op->getattr() instance and only
for directory inodes (/proc/*/fd and /proc/*/task/*/fd)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Link: https://lore.kernel.org/20250615003321.GC3011112@ZenIV
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Al Viro and committed by
Christian Brauner
b5ba648a 88b1de54

+1 -10
+1 -10
fs/proc/fd.c
··· 352 352 u32 request_mask, unsigned int query_flags) 353 353 { 354 354 struct inode *inode = d_inode(path->dentry); 355 - int rv = 0; 356 355 357 356 generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat); 358 - 359 - /* If it's a directory, put the number of open fds there */ 360 - if (S_ISDIR(inode->i_mode)) { 361 - rv = proc_readfd_count(inode, &stat->size); 362 - if (rv < 0) 363 - return rv; 364 - } 365 - 366 - return rv; 357 + return proc_readfd_count(inode, &stat->size); 367 358 } 368 359 369 360 const struct inode_operations proc_fd_inode_operations = {