From 96aa615f91cd25b04c393f16f122e33f6744fdc9 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Fri, 27 Aug 2021 08:42:56 +0300 Subject: [PATCH] LU-14967 obdclass: EAGAIN after rhashtable_walk_next() 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(). Signed-off-by: Alex Zhuravlev Change-Id: I15ba2cdf16c2678e18836b4f16b56a3b8bfdacd0 Reviewed-on: https://review.whamcloud.com/44766 Tested-by: jenkins Reviewed-by: Patrick Farrell Reviewed-by: Aurelien Degremont Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Neil Brown Reviewed-by: Oleg Drokin --- lustre/llite/vvp_dev.c | 6 ++++++ lustre/obdclass/jobid.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/lustre/llite/vvp_dev.c b/lustre/llite/vvp_dev.c index 7db2a47..05ce3c8 100644 --- a/lustre/llite/vvp_dev.c +++ b/lustre/llite/vvp_dev.c @@ -411,6 +411,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/lustre/obdclass/jobid.c b/lustre/obdclass/jobid.c index 1093f78..207a88b 100644 --- a/lustre/obdclass/jobid.c +++ b/lustre/obdclass/jobid.c @@ -182,6 +182,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