aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/dir.c
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-02-05 16:41:23 -0500
committerYan, Zheng <zheng.z.yan@intel.com>2014-04-02 22:33:53 -0400
commit4b58c9b19bddb47a1961608bc62d0c2f3dc9705e (patch)
tree41a7b687f380b397d379883295a6994e098583b5 /fs/ceph/dir.c
parent844d87c3329980e2b1849cf53205d7fa965d8995 (diff)
ceph: do not set r_old_dentry_dir on link()
This is racy--we do not know whather d_parent has changed out from underneath us because i_mutex is not held on the source inode's directory. Also, taking this reference is useless. Reported-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Yan, Zheng <zheng.z.yan@intel.com>
Diffstat (limited to 'fs/ceph/dir.c')
-rw-r--r--fs/ceph/dir.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index e07973718ebe..ff2864a36a1c 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -812,8 +812,7 @@ static int ceph_link(struct dentry *old_dentry, struct inode *dir,
812 } 812 }
813 req->r_dentry = dget(dentry); 813 req->r_dentry = dget(dentry);
814 req->r_num_caps = 2; 814 req->r_num_caps = 2;
815 req->r_old_dentry = dget(old_dentry); /* or inode? hrm. */ 815 req->r_old_dentry = dget(old_dentry);
816 req->r_old_dentry_dir = ceph_get_dentry_parent_inode(old_dentry);
817 req->r_locked_dir = dir; 816 req->r_locked_dir = dir;
818 req->r_dentry_drop = CEPH_CAP_FILE_SHARED; 817 req->r_dentry_drop = CEPH_CAP_FILE_SHARED;
819 req->r_dentry_unless = CEPH_CAP_FILE_EXCL; 818 req->r_dentry_unless = CEPH_CAP_FILE_EXCL;