ceph: reset cap hold timeout only for requeued inode
authorChengguang Xu <cgxu519@gmx.com>
Mon, 30 Jul 2018 15:55:36 +0000 (23:55 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 22 Oct 2018 08:28:19 +0000 (10:28 +0200)
__cap_delay_requeue() only requeue inode which does not
have CEPH_I_FLUSH flag, so avoid reset cap hold timeout
for that inode.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/caps.c

index dd7dfdd2ba13903575aee52a0b8fc27660cda2f8..b26ae167399281497150303da1b65d064ab44ca6 100644 (file)
@@ -521,7 +521,6 @@ static void __cap_set_timeouts(struct ceph_mds_client *mdsc,
 static void __cap_delay_requeue(struct ceph_mds_client *mdsc,
                                struct ceph_inode_info *ci)
 {
-       __cap_set_timeouts(mdsc, ci);
        dout("__cap_delay_requeue %p flags %d at %lu\n", &ci->vfs_inode,
             ci->i_ceph_flags, ci->i_hold_caps_max);
        if (!mdsc->stopping) {
@@ -531,6 +530,7 @@ static void __cap_delay_requeue(struct ceph_mds_client *mdsc,
                                goto no_change;
                        list_del_init(&ci->i_cap_delay_list);
                }
+               __cap_set_timeouts(mdsc, ci);
                list_add_tail(&ci->i_cap_delay_list, &mdsc->cap_delay_list);
 no_change:
                spin_unlock(&mdsc->cap_delay_lock);