ceph: break the check delayed cap loop every 5s

In some cases this may take a long time and will block renewing
the caps to MDS.

[ idryomov: massage comment ]

Link: https://tracker.ceph.com/issues/50223#note-21
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
Xiubo Li 2024-01-17 12:42:11 +08:00 committed by Ilya Dryomov
parent e8f897f4af
commit 09927e7ef1
1 changed files with 8 additions and 0 deletions

View File

@ -4634,6 +4634,14 @@ unsigned long ceph_check_delayed_caps(struct ceph_mds_client *mdsc)
iput(inode);
spin_lock(&mdsc->cap_delay_lock);
}
/*
* Make sure too many dirty caps or general
* slowness doesn't block mdsc delayed work,
* preventing send_renew_caps() from running.
*/
if (jiffies - loop_start >= 5 * HZ)
break;
}
spin_unlock(&mdsc->cap_delay_lock);
doutc(cl, "done\n");