From 06134ff9addec8c74af78dd0f361f503ef8d3ba6 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Mon, 28 Feb 2022 22:14:37 -0700 Subject: [PATCH] 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 --- lustre/osd-ldiskfs/osd_scrub.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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 { -- 1.8.3.1