Skip to contentSkip to conversation

ceph: break the check delayed cap loop every 5s

PATCH New [email protected] 1 participant 1 message Jan 17, 2024 Ceph client

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: break the check delayed cap loop every 5s

From: Xiubo Li <[email protected]>

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

---
 fs/ceph/caps.c | 8 ++++++++
 1 file changed, 8 insertions(+)
fs/ceph/caps.c +8 -0
index ba94ad6d45fe..5501c86b337d 100644
@@ -4647,6 +4647,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");
Signature · 1 line
2.39.1