ceph: handle racing calls to ceph_init_dentry
authorSage Weil <sage@newdream.net>
Tue, 26 Jul 2011 18:30:15 +0000 (11:30 -0700)
committerSage Weil <sage@newdream.net>
Tue, 26 Jul 2011 18:30:15 +0000 (11:30 -0700)
commit48d0cbd1242aac969560ef8b90f26ee3b09a6a5c
tree228a26f8ee7d555d67c6a00e5346f3b558a2e48c
parentdfabbed6fdd509dc2beb89c954bc36014a1bc7cb
ceph: handle racing calls to ceph_init_dentry

The ->lookup() and prepopulate_readdir() callers are working with unhashed
dentries, so we don't have to worry.  The export.c callers, though, need
to initialize something they got back from d_obtain_alias() and are
potentially racing with other callers.  Make sure we don't return unless
the dentry is properly initialized (by us or someone else).

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Reviewed-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/dir.c