]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ceph: trigger the reclaim work once there has enough pending caps
authorXiubo Li <xiubli@redhat.com>
Tue, 26 Nov 2019 12:32:22 +0000 (07:32 -0500)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 9 Dec 2019 19:55:10 +0000 (20:55 +0100)
The nr in ceph_reclaim_caps_nr() is very possibly larger than 1,
so we may miss it and the reclaim work couldn't triggered as expected.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/mds_client.c

index f8735fc9f9d6d5d79d4a8504a9141eb15c837fff..374db1bd57d10b8ca74c7081c31744a850fad612 100644 (file)
@@ -2015,7 +2015,7 @@ void ceph_reclaim_caps_nr(struct ceph_mds_client *mdsc, int nr)
        if (!nr)
                return;
        val = atomic_add_return(nr, &mdsc->cap_reclaim_pending);
-       if (!(val % CEPH_CAPS_PER_RELEASE)) {
+       if ((val % CEPH_CAPS_PER_RELEASE) < nr) {
                atomic_set(&mdsc->cap_reclaim_pending, 0);
                ceph_queue_cap_reclaim_work(mdsc);
        }