.. | .. |
---|
63 | 63 | /* Paired with READ_ONCE() in wait_for_unix_gc() */ |
---|
64 | 64 | WRITE_ONCE(unix_tot_inflight, unix_tot_inflight + 1); |
---|
65 | 65 | } |
---|
66 | | - user->unix_inflight++; |
---|
| 66 | + WRITE_ONCE(user->unix_inflight, user->unix_inflight + 1); |
---|
67 | 67 | spin_unlock(&unix_gc_lock); |
---|
68 | 68 | } |
---|
69 | 69 | |
---|
.. | .. |
---|
84 | 84 | /* Paired with READ_ONCE() in wait_for_unix_gc() */ |
---|
85 | 85 | WRITE_ONCE(unix_tot_inflight, unix_tot_inflight - 1); |
---|
86 | 86 | } |
---|
87 | | - user->unix_inflight--; |
---|
| 87 | + WRITE_ONCE(user->unix_inflight, user->unix_inflight - 1); |
---|
88 | 88 | spin_unlock(&unix_gc_lock); |
---|
89 | 89 | } |
---|
90 | 90 | |
---|
.. | .. |
---|
98 | 98 | { |
---|
99 | 99 | struct user_struct *user = current_user(); |
---|
100 | 100 | |
---|
101 | | - if (unlikely(user->unix_inflight > task_rlimit(p, RLIMIT_NOFILE))) |
---|
| 101 | + if (unlikely(READ_ONCE(user->unix_inflight) > task_rlimit(p, RLIMIT_NOFILE))) |
---|
102 | 102 | return !capable(CAP_SYS_RESOURCE) && !capable(CAP_SYS_ADMIN); |
---|
103 | 103 | return false; |
---|
104 | 104 | } |
---|