From: Jeff Layton <jlayton@redhat.com> Date: Thu, 26 Jan 2017 21:14:18 +0000 (-0500) Subject: ceph: don't update_dentry_lease unless we actually got one X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=80d025ffede88969f6adf7266fbdedfd5641148a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 <jlayton@redhat.com> Reviewed-by: Yan, Zheng <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com> --- 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,