| Kernel v2.4.6 /fs/select.c |
|---|
 2.4.6
 fs
 select.c
diff -u --recursive --new-file v2.4.5/linux/fs/select.c linux/fs/select.c
--- v2.4.5/linux/fs/select.c Wed May 16 10:31:27 2001
+++ linux/fs/select.c Wed Jun 27 17:10:55 2001
@@ -260,7 +260,7 @@
fd_set_bits fds;
char *bits;
long timeout;
- int ret, size;
+ int ret, size, max_fdset;
timeout = MAX_SCHEDULE_TIMEOUT;
if (tvp) {
@@ -285,8 +285,10 @@
if (n < 0)
goto out_nofds;
- if (n > current->files->max_fdset)
- n = current->files->max_fdset;
+ /* max_fdset can increase, so grab it once to avoid race */
+ max_fdset = current->files->max_fdset;
+ if (n > max_fdset)
+ n = max_fdset;
/*
* We need 6 bitmaps (in/out/ex for both incoming and outgoing),
|