struct kstat is thread local.

Signed-off-by: Alexey Dobriyan <[email protected]>
---

 fs/proc/base.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1787,9 +1787,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)) {

Reply via email to