diff options
author | Luis Henriques <lhenriques@suse.de> | 2021-07-06 14:52:41 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-08-18 08:56:57 +0200 |
commit | a753e3f334053ab0dbb9d9f7db8024302038ddd6 (patch) | |
tree | b5ca3439ece5a8e3a41fc7d4c74801f5accd35a7 /fs/ceph/super.h | |
parent | aa04486c419d7a8b4032549a11bd46acb1b6d0ac (diff) | |
download | linux-stable-a753e3f334053ab0dbb9d9f7db8024302038ddd6.tar.gz linux-stable-a753e3f334053ab0dbb9d9f7db8024302038ddd6.tar.bz2 linux-stable-a753e3f334053ab0dbb9d9f7db8024302038ddd6.zip |
ceph: reduce contention in ceph_check_delayed_caps()
commit bf2ba432213fade50dd39f2e348085b758c0726e upstream.
Function ceph_check_delayed_caps() is called from the mdsc->delayed_work
workqueue and it can be kept looping for quite some time if caps keep
being added back to the mdsc->cap_delay_list. This may result in the
watchdog tainting the kernel with the softlockup flag.
This patch breaks this loop if the caps have been recently (i.e. during
the loop execution). Any new caps added to the list will be handled in
the next run.
Also, allow schedule_delayed() callers to explicitly set the delay value
instead of defaulting to 5s, so we can ensure that it runs soon
afterward if it looks like there is more work.
Cc: stable@vger.kernel.org
URL: https://tracker.ceph.com/issues/46284
Signed-off-by: Luis Henriques <lhenriques@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/ceph/super.h')
-rw-r--r-- | fs/ceph/super.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index bb12c9f3a218..8ffc8e88dd3d 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -1064,7 +1064,7 @@ extern void ceph_flush_snaps(struct ceph_inode_info *ci, extern bool __ceph_should_report_size(struct ceph_inode_info *ci); extern void ceph_check_caps(struct ceph_inode_info *ci, int flags, struct ceph_mds_session *session); -extern void ceph_check_delayed_caps(struct ceph_mds_client *mdsc); +extern unsigned long ceph_check_delayed_caps(struct ceph_mds_client *mdsc); extern void ceph_flush_dirty_caps(struct ceph_mds_client *mdsc); extern int ceph_drop_caps_for_unlink(struct inode *inode); extern int ceph_encode_inode_release(void **p, struct inode *inode, |