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 @@ -64,7 +64,7 @@ void unix_inflight(struct user_struct *user, struct file *fp)
64
64
/* Paired with READ_ONCE() in wait_for_unix_gc() */
65
65
WRITE_ONCE (unix_tot_inflight , unix_tot_inflight + 1 );
66
66
}
67
- user -> unix_inflight ++ ;
67
+ WRITE_ONCE ( user -> unix_inflight , user -> unix_inflight + 1 ) ;
68
68
spin_unlock (& unix_gc_lock );
69
69
}
70
70
@@ -85,7 +85,7 @@ void unix_notinflight(struct user_struct *user, struct file *fp)
85
85
/* Paired with READ_ONCE() in wait_for_unix_gc() */
86
86
WRITE_ONCE (unix_tot_inflight , unix_tot_inflight - 1 );
87
87
}
88
- user -> unix_inflight -- ;
88
+ WRITE_ONCE ( user -> unix_inflight , user -> unix_inflight - 1 ) ;
89
89
spin_unlock (& unix_gc_lock );
90
90
}
91
91
@@ -99,7 +99,7 @@ static inline bool too_many_unix_fds(struct task_struct *p)
99
99
{
100
100
struct user_struct * user = current_user ();
101
101
102
- if (unlikely (user -> unix_inflight > task_rlimit (p , RLIMIT_NOFILE )))
102
+ if (unlikely (READ_ONCE ( user -> unix_inflight ) > task_rlimit (p , RLIMIT_NOFILE )))
103
103
return !capable (CAP_SYS_RESOURCE ) && !capable (CAP_SYS_ADMIN );
104
104
return false;
105
105
}
You can’t perform that action at this time.
0 commit comments