Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.4.6 /fs/select.c

Filename:/fs/select.c
Lines Added:5
Lines Deleted:3
Also changed in: (Previous) 2.4.6-pre9  2.4.6-pre8  2.4.6-pre7  2.4.6-pre6  2.4.5-ac24  2.4.5-ac23 
(Following) 2.4.8-ac12  2.4.9-pre4  2.4.9  2.4.9-ac11  2.4.9-ac12  2.4.9-ac13 

Location
[  2.4.6
  [  fs
     o  select.c

Patch

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),


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.