]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
ceph: break the check delayed cap loop every 5s
authorXiubo Li <xiubli@redhat.com>
Wed, 17 Jan 2024 04:42:11 +0000 (12:42 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 13 Feb 2024 10:25:13 +0000 (11:25 +0100)
In some cases this may take a long time and will block renewing
the caps to MDS.

URL: https://tracker.ceph.com/issues/50223#note-21
Signed-off-by: Xiubo Li <xiubli@redhat.com>
fs/ceph/caps.c

index 1a4ce8ffcf1cb3783cf66dcbef08e2e20ba63569..0ca7dce481725313ccbce913d0b49f84343e0342 100644 (file)
@@ -4648,6 +4648,14 @@ unsigned long ceph_check_delayed_caps(struct ceph_mds_client *mdsc)
                        iput(inode);
                        spin_lock(&mdsc->cap_delay_lock);
                }
+
+               /*
+                * Just in case too many dirty caps or slow
+                * performance case won't block the delayed
+                * work to renew the caps.
+                */
+               if (jiffies - loop_start >= 5 * HZ)
+                       break;
        }
        spin_unlock(&mdsc->cap_delay_lock);
        doutc(cl, "done\n");