Commit 09927e7e authored by Xiubo Li's avatar Xiubo Li Committed by Ilya Dryomov
Browse files

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: default avatarXiubo Li <xiubli@redhat.com>
Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent e8f897f4
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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");