From 80d025ffede88969f6adf7266fbdedfd5641148a Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Thu, 26 Jan 2017 16:14:18 -0500 Subject: ceph: don't update_dentry_lease unless we actually got one This if block updates the dentry lease even in the case where the MDS didn't grant one. Signed-off-by: Jeff Layton Reviewed-by: Yan, Zheng Signed-off-by: Ilya Dryomov --- fs/ceph/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs/ceph') diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 35a8c453bea6..542e3c6b0f1b 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -1286,8 +1286,8 @@ retry_lookup: ceph_dir_clear_ordered(dir); dout("d_delete %p\n", dn); d_delete(dn); - } else { - if (have_lease && d_unhashed(dn)) + } else if (have_lease) { + if (d_unhashed(dn)) d_add(dn, NULL); update_dentry_lease(dn, rinfo->dlease, session, -- cgit v1.2.3