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

James Simmons jsimmons at infradead.org
Tue Sep 21 19:19:57 PDT 2021


From: Alex Zhuravlev <bzzz at 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 at whamcloud.com>
Reviewed-on: https://review.whamcloud.com/44766
Reviewed-by: Patrick Farrell <pfarrell at whamcloud.com>
Reviewed-by: Aurelien Degremont <degremoa at amazon.com>
Reviewed-by: James Simmons <jsimmons at infradead.org>
Reviewed-by: Neil Brown <neilb at suse.de>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/llite/vvp_dev.c  | 6 ++++++
 fs/lustre/obdclass/jobid.c | 5 +++++
 2 files changed, 11 insertions(+)

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;
-- 
1.8.3.1



More information about the lustre-devel mailing list