lkml.org 
[lkml]   [2001]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectfork/open race results in wasted fd
Two tasks (A & B) share the same files_struct. A calls open() at the same time
as B calls fork(). After A runs get_unused_fd() but before it calls
fd_install(), B runs copy_files().

It looks like the result is one of the bits is set in B's open_fds field with no
corresponding file pointer in its fd array. The fd is unusable, and attempting
to close() it would return EBADF.

Is this a known race?

-Brian (please copy me in response)
-
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/

\
 
 \ /
  Last update: 2005-03-22 12:54    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site