ceph: trigger the reclaim work once there has enough pending caps

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>
This commit is contained in:
Xiubo Li 2019-11-26 07:32:22 -05:00 committed by Ilya Dryomov
parent 3a3430affc
commit bba1560bd4

View File

@ -2015,7 +2015,7 @@ void ceph_reclaim_caps_nr(struct ceph_mds_client *mdsc, int nr)
if (!nr) if (!nr)
return; return;
val = atomic_add_return(nr, &mdsc->cap_reclaim_pending); 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); atomic_set(&mdsc->cap_reclaim_pending, 0);
ceph_queue_cap_reclaim_work(mdsc); ceph_queue_cap_reclaim_work(mdsc);
} }