Commit 8d8f371c authored by Yan, Zheng's avatar Yan, Zheng Committed by Ilya Dryomov

ceph: cleanup traceless reply handling for rename

ceph_fill_trace() already calls ceph_invalidate_dir_request() for
traceless reply. No need to duplicate the code in ceph_rename().
Signed-off-by: default avatar"Yan, Zheng" <zyan@redhat.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 87c91a96
...@@ -1107,16 +1107,7 @@ static int ceph_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1107,16 +1107,7 @@ static int ceph_rename(struct inode *old_dir, struct dentry *old_dentry,
* do_request, above). If there is no trace, we need * do_request, above). If there is no trace, we need
* to do it here. * to do it here.
*/ */
/* d_move screws up sibling dentries' offsets */
ceph_dir_clear_complete(old_dir);
ceph_dir_clear_complete(new_dir);
d_move(old_dentry, new_dentry); d_move(old_dentry, new_dentry);
/* ensure target dentry is invalidated, despite
rehashing bug in vfs_rename_dir */
ceph_invalidate_dentry_lease(new_dentry);
} }
ceph_mdsc_put_request(req); ceph_mdsc_put_request(req);
return err; return err;
......
...@@ -2438,11 +2438,14 @@ int ceph_mdsc_do_request(struct ceph_mds_client *mdsc, ...@@ -2438,11 +2438,14 @@ int ceph_mdsc_do_request(struct ceph_mds_client *mdsc,
*/ */
void ceph_invalidate_dir_request(struct ceph_mds_request *req) void ceph_invalidate_dir_request(struct ceph_mds_request *req)
{ {
struct inode *inode = req->r_parent; struct inode *dir = req->r_parent;
struct inode *old_dir = req->r_old_dentry_dir;
dout("invalidate_dir_request %p (complete, lease(s))\n", inode); dout("invalidate_dir_request %p %p (complete, lease(s))\n", dir, old_dir);
ceph_dir_clear_complete(inode); ceph_dir_clear_complete(dir);
if (old_dir)
ceph_dir_clear_complete(old_dir);
if (req->r_dentry) if (req->r_dentry)
ceph_invalidate_dentry_lease(req->r_dentry); ceph_invalidate_dentry_lease(req->r_dentry);
if (req->r_old_dentry) if (req->r_old_dentry)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment