Messages in this thread | | | Subject | Re: [RFC v10][PATCH 08/13] Dump open file descriptors | From | Dave Hansen <> | Date | Mon, 01 Dec 2008 12:51:19 -0800 |
| |
On Mon, 2008-12-01 at 15:23 -0500, Oren Laadan wrote: > Verifying that the size doesn't change does not ensure that the table's > contents remained the same, so we can still end up with obsolete data.
With the realloc() scheme, we have virtually no guarantees about how the fdtable that we read relates to the source. All that we know is that the n'th fd was at this value at *some* time.
Using the scheme that I just suggested (and you evidently originally used) at least guarantees that we have an atomic copy of the fdtable.
Why is this done in two steps? It first grabs a list of fd numbers which needs to be validated, then goes back and turns those into 'struct file's which it saves off. Is there a problem with doing that fd->'struct file' conversion under the files->file_lock?
-- Dave
| |