diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2010-06-30 09:48:50 -0400 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2010-08-02 15:28:35 -0400 |
commit | a534c8d15b1f1d0f861fc2bb9e0529bd8486ec3f (patch) | |
tree | 0451da7a61bd7e3eb5968d65beee3243f7f51b5d /fs/9p/v9fs.c | |
parent | ebf46264a004818fe5b23f0ac18ac7336897d807 (diff) |
fs/9p: Prevent parallel rename when doing fid_lookup
During fid lookup we need to make sure that the dentry->d_parent doesn't
change so that we can safely walk the parent dentries. To ensure that
we need to prevent cross directory rename during fid_lookup. Add a
per superblock rename_sem rw_semaphore to prevent parallel fid lookup and
rename.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'fs/9p/v9fs.c')
-rw-r--r-- | fs/9p/v9fs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c index 3c492011221c..38dc0e067599 100644 --- a/fs/9p/v9fs.c +++ b/fs/9p/v9fs.c | |||
@@ -237,6 +237,7 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses, | |||
237 | __putname(v9ses->uname); | 237 | __putname(v9ses->uname); |
238 | return ERR_PTR(-ENOMEM); | 238 | return ERR_PTR(-ENOMEM); |
239 | } | 239 | } |
240 | init_rwsem(&v9ses->rename_sem); | ||
240 | 241 | ||
241 | rc = bdi_setup_and_register(&v9ses->bdi, "9p", BDI_CAP_MAP_COPY); | 242 | rc = bdi_setup_and_register(&v9ses->bdi, "9p", BDI_CAP_MAP_COPY); |
242 | if (rc) { | 243 | if (rc) { |