mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-09-21 20:22:13 +08:00
Preempt-safe RCU file usage
Fix up fs/compat.c fixes.
This commit is contained in:
parent
f0eca9626c
commit
ac5b8b6f22
@ -1645,8 +1645,10 @@ compat_sys_select(int n, compat_ulong_t __user *inp, compat_ulong_t __user *outp
|
|||||||
goto out_nofds;
|
goto out_nofds;
|
||||||
|
|
||||||
/* max_fdset can increase, so grab it once to avoid race */
|
/* max_fdset can increase, so grab it once to avoid race */
|
||||||
|
rcu_read_lock();
|
||||||
fdt = files_fdtable(current->files);
|
fdt = files_fdtable(current->files);
|
||||||
max_fdset = fdt->max_fdset;
|
max_fdset = fdt->max_fdset;
|
||||||
|
rcu_read_unlock();
|
||||||
if (n > max_fdset)
|
if (n > max_fdset)
|
||||||
n = max_fdset;
|
n = max_fdset;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user