Re: [RFC v10][PATCH 08/13] Dump open file descriptors

From: Dave Hansen
Date: Mon Dec 01 2008 - 15:51:36 EST


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/