Skip to content

Commit 09927e7

Browse files
lxbszidryomov
authored andcommitted
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>
1 parent e8f897f commit 09927e7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

fs/ceph/caps.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4634,6 +4634,14 @@ unsigned long ceph_check_delayed_caps(struct ceph_mds_client *mdsc)
46344634
iput(inode);
46354635
spin_lock(&mdsc->cap_delay_lock);
46364636
}
4637+
4638+
/*
4639+
* Make sure too many dirty caps or general
4640+
* slowness doesn't block mdsc delayed work,
4641+
* preventing send_renew_caps() from running.
4642+
*/
4643+
if (jiffies - loop_start >= 5 * HZ)
4644+
break;
46374645
}
46384646
spin_unlock(&mdsc->cap_delay_lock);
46394647
doutc(cl, "done\n");

0 commit comments

Comments
 (0)