patch-2.3.10 linux/fs/select.c

Next file: linux/fs/super.c
Previous file: linux/fs/qnx4/symlinks.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.9/linux/fs/select.c linux/fs/select.c
@@ -64,9 +64,9 @@
 		if (p->nr < __MAX_POLL_TABLE_ENTRIES) {
 			struct poll_table_entry * entry;
 ok_table:
-			entry = p->entry + p->nr;
-			entry->filp = filp;
-			atomic_inc(&filp->f_count);
+		 	entry = p->entry + p->nr;
+		 	get_file(filp);
+		 	entry->filp = filp;
 			entry->wait_address = wait_address;
 			init_waitqueue_entry(&entry->wait, current);
 			add_wait_queue(wait_address,&entry->wait);
@@ -164,9 +164,11 @@
 		wait = wait_table;
 	}
 
-	lock_kernel();
-
+	read_lock(&current->files->file_lock);
 	retval = max_select_fd(n, fds);
+	read_unlock(&current->files->file_lock);
+
+	lock_kernel();
 	if (retval < 0)
 		goto out;
 	n = retval;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)