diff mbox series

[20/24] lustre: obdclass: EAGAIN after rhashtable_walk_next()

Message ID 1632277201-6920-21-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: Update to OpenSFS Sept 21, 2021 | expand

Commit Message

James Simmons Sept. 22, 2021, 2:19 a.m. UTC
From: Alex Zhuravlev <bzzz@whamcloud.com>

rhashtable_walk_next() can return -EAGAIN when concurrent resizing
has happened. so the callers should check for this error and just
repeat rhashtable_walk_next().

WC-bug-id: https://jira.whamcloud.com/browse/LU-14967
Lustre-commit: 96aa615f91cd25b04 ("LU-14967 obdclass: EAGAIN after rhashtable_walk_next()")
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/44766
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Aurelien Degremont <degremoa@amazon.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/llite/vvp_dev.c  | 6 ++++++
 fs/lustre/obdclass/jobid.c | 5 +++++
 2 files changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/fs/lustre/llite/vvp_dev.c b/fs/lustre/llite/vvp_dev.c
index fdcd314..fda48bb 100644
--- a/fs/lustre/llite/vvp_dev.c
+++ b/fs/lustre/llite/vvp_dev.c
@@ -385,6 +385,12 @@  static struct page *vvp_pgcache_current(struct vvp_seq_private *priv)
 		struct inode *inode;
 		int nr;
 
+		if (IS_ERR(h)) {
+			if (PTR_ERR(h) == -EAGAIN)
+				continue;
+			break;
+		}
+
 		if (!priv->vsp_clob) {
 			struct lu_object *lu_obj;
 
diff --git a/fs/lustre/obdclass/jobid.c b/fs/lustre/obdclass/jobid.c
index 52ba398..da1af51 100644
--- a/fs/lustre/obdclass/jobid.c
+++ b/fs/lustre/obdclass/jobid.c
@@ -164,6 +164,11 @@  static void jobid_prune(struct work_struct *work)
 	rhashtable_walk_enter(&session_jobids, &iter);
 	rhashtable_walk_start(&iter);
 	while ((sj = rhashtable_walk_next(&iter)) != NULL) {
+		if (IS_ERR(sj)) {
+			if (PTR_ERR(sj) == -EAGAIN)
+				continue;
+			break;
+		}
 		if (!hlist_empty(&sj->sj_session->tasks[PIDTYPE_SID])) {
 			remaining++;
 			continue;