Whamcloud - gitweb
LU-15601 osd-ldiskfs: handle read_inode_bitmap() error 60/46660/3
authorAndreas Dilger <adilger@whamcloud.com>
Tue, 1 Mar 2022 05:14:37 +0000 (22:14 -0700)
committerOleg Drokin <green@whamcloud.com>
Sat, 5 Mar 2022 20:44:05 +0000 (20:44 +0000)
Correctly handle a PTR_ERR() error return from read_inode_bitmap().
This changed in upstream kernel commit v4.3-rc2-17-g9008a58e5dce,
so handle this for both types of return value.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I184c09b300ed69c29e4a7ef343f473b67080381f
Reviewed-on: https://review.whamcloud.com/46660
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osd-ldiskfs/osd_scrub.c

index 031acd2..ffe4a0b 100644 (file)
@@ -1047,11 +1047,16 @@ full:
                }
 
                param->bitmap = ldiskfs_read_inode_bitmap(param->sb, param->bg);
-               if (!param->bitmap) {
-                       CERROR("%s: fail to read bitmap for %u, "
-                              "scrub will stop, urgent mode\n",
-                              osd_scrub2name(scrub), (__u32)param->bg);
-                       RETURN(-EIO);
+               if (IS_ERR_OR_NULL(param->bitmap)) {
+                       if (param->bitmap) {
+                               rc = PTR_ERR(param->bitmap);
+                               param->bitmap = NULL;
+                       } else {
+                               rc = -EIO;
+                       }
+                       CERROR("%s: fail to read bitmap for %u, scrub will stop, urgent mode: rc = %d\n",
+                              osd_scrub2name(scrub), (__u32)param->bg, rc);
+                       GOTO(out, rc);
                }
 
                do {