Whamcloud - gitweb
LU-14967 obdclass: EAGAIN after rhashtable_walk_next() 66/44766/3
authorAlex Zhuravlev <bzzz@whamcloud.com>
Fri, 27 Aug 2021 05:42:56 +0000 (08:42 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 11 Sep 2021 06:21:59 +0000 (06:21 +0000)
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 <bzzz@whamcloud.com>
Change-Id: I15ba2cdf16c2678e18836b4f16b56a3b8bfdacd0
Reviewed-on: https://review.whamcloud.com/44766
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Aurelien Degremont <degremoa@amazon.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/vvp_dev.c
lustre/obdclass/jobid.c

index 7db2a47..05ce3c8 100644 (file)
@@ -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;
 
index 1093f78..207a88b 100644 (file)
@@ -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;