diff options
| author | Pavel Emelyanov <[email protected]> | 2010-05-17 16:00:37 +0000 |
|---|---|---|
| committer | J. Bruce Fields <[email protected]> | 2010-05-18 16:05:20 +0000 |
| commit | 47cee541a46a73b20dc279bf4c4690f776f6c81b (patch) | |
| tree | d54461a8fd6a4c70d5b092334ccf38359bcd4994 /fs/proc/array.c | |
| parent | nfs4: minor callback code simplification, comment (diff) | |
| download | kernel-47cee541a46a73b20dc279bf4c4690f776f6c81b.tar.gz kernel-47cee541a46a73b20dc279bf4c4690f776f6c81b.zip | |
nfsd: safer initialization order in find_file()
The alloc_init_file() first adds a file to the hash and then
initializes its fi_inode, fi_id and fi_had_conflict.
The uninitialized fi_inode could thus be erroneously checked by
the find_file(), so move the hash insertion lower.
The client_mutex should prevent this race in practice; however, we
eventually hope to make less use of the client_mutex, so the ordering
here is an accident waiting to happen.
I didn't find whether the same can be true for two other fields,
but the common sense tells me it's better to initialize an object
before putting it into a global hash table :)
Signed-off-by: Pavel Emelyanov <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
Diffstat (limited to 'fs/proc/array.c')
0 files changed, 0 insertions, 0 deletions
