From: Sage Weil Date: Tue, 5 Feb 2013 21:41:23 +0000 (-0800) Subject: ceph: do not set r_old_dentry_dir on link() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4b58c9b19bddb47a1961608bc62d0c2f3dc9705e;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Sage Weil Reviewed-by: Yan, Zheng --- 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, } req->r_dentry = dget(dentry); req->r_num_caps = 2; - req->r_old_dentry = dget(old_dentry); /* or inode? hrm. */ - req->r_old_dentry_dir = ceph_get_dentry_parent_inode(old_dentry); + req->r_old_dentry = dget(old_dentry); req->r_locked_dir = dir; req->r_dentry_drop = CEPH_CAP_FILE_SHARED; req->r_dentry_unless = CEPH_CAP_FILE_EXCL;