Skip to content

Commit

Permalink
Preempt-safe RCU file usage
Browse files Browse the repository at this point in the history
Fix up fs/compat.c fixes.
  • Loading branch information
Linus Torvalds committed Sep 9, 2005
1 parent f0eca96 commit ac5b8b6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1645,8 +1645,10 @@ compat_sys_select(int n, compat_ulong_t __user *inp, compat_ulong_t __user *outp
goto out_nofds;

/* max_fdset can increase, so grab it once to avoid race */
rcu_read_lock();
fdt = files_fdtable(current->files);
max_fdset = fdt->max_fdset;
rcu_read_unlock();
if (n > max_fdset)
n = max_fdset;

Expand Down

0 comments on commit ac5b8b6

Please sign in to comment.