From: Andreas Dilger Date: Tue, 1 Mar 2022 05:14:37 +0000 (-0700) Subject: LU-15601 osd-ldiskfs: handle read_inode_bitmap() error X-Git-Tag: 2.15.0-RC3~34 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=06134ff9addec8c74af78dd0f361f503ef8d3ba6;p=fs%2Flustre-release.git LU-15601 osd-ldiskfs: handle read_inode_bitmap() error 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 Change-Id: I184c09b300ed69c29e4a7ef343f473b67080381f Reviewed-on: https://review.whamcloud.com/46660 Tested-by: jenkins Reviewed-by: Yang Sheng Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/osd-ldiskfs/osd_scrub.c b/lustre/osd-ldiskfs/osd_scrub.c index 031acd2..ffe4a0b 100644 --- a/lustre/osd-ldiskfs/osd_scrub.c +++ b/lustre/osd-ldiskfs/osd_scrub.c @@ -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 {