From: Alexey Dobriyan Date: Fri, 8 Jun 2018 00:10:07 +0000 (-0700) Subject: proc: smaller RCU section in ->getattr() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=941169298a3e60db694373acbb49cd6569c8398b;p=openwrt%2Fstaging%2Fblogic.git proc: smaller RCU section in ->getattr() struct kstat is thread local. Link: http://lkml.kernel.org/r/20180423213626.GB9043@avx2 Signed-off-by: Alexey Dobriyan Reviewed-by: Andrew Morton Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/proc/base.c b/fs/proc/base.c index 3954f50805b8..97af285c63e1 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1755,9 +1755,9 @@ int pid_getattr(const struct path *path, struct kstat *stat, generic_fillattr(inode, stat); - rcu_read_lock(); stat->uid = GLOBAL_ROOT_UID; stat->gid = GLOBAL_ROOT_GID; + rcu_read_lock(); task = pid_task(proc_pid(inode), PIDTYPE_PID); if (task) { if (!has_pid_permissions(pid, task, HIDEPID_INVISIBLE)) {