Messages in this thread Patch in this message | | | Date | Fri, 24 Jun 2005 16:22:09 +0530 | From | Dipankar Sarma <> | Subject | Re: [PATCH 1/4] files: fix dupfd by fdt reload |
| |
locate_fd() may expand fdtable, so the fdtable pointer must be reloaded after locate_fd(). Fixes bugme #4770.
Signed-off-by: Dipankar Sarma <dipankar@in.ibm.com> ---
fs/fcntl.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-)
diff -puN fs/fcntl.c~fix-dupfd-reacquire-fdt fs/fcntl.c --- linux-2.6.12-mm1-fix/fs/fcntl.c~fix-dupfd-reacquire-fdt 2005-06-25 14:56:58.000000000 +0530 +++ linux-2.6.12-mm1-fix-dipankar/fs/fcntl.c 2005-06-25 14:58:26.000000000 +0530 @@ -118,9 +118,10 @@ static int dupfd(struct file *file, unsi int fd; spin_lock(&files->file_lock); - fdt = files_fdtable(files); fd = locate_fd(files, file, start); if (fd >= 0) { + /* locate_fd() may have expanded fdtable, load the ptr */ + fdt = files_fdtable(files); FD_SET(fd, fdt->open_fds); FD_CLR(fd, fdt->close_on_exec); spin_unlock(&files->file_lock); _ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |