File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ void unix_inflight(struct user_struct *user, struct file *fp)
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,7 +84,7 @@ void unix_notinflight(struct user_struct *user, struct file *fp)
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,7 +98,7 @@ static inline bool too_many_unix_fds(struct task_struct *p)
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
}
You can’t perform that action at this time.
0 commit comments