From: Wang Shilong Date: Fri, 19 Mar 2021 07:31:55 +0000 (+0800) Subject: LU-8465 ext2fs: RO open for bitmap loading X-Git-Tag: v1.45.6.wc6~2 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=c0f60f89;p=tools%2Fe2fsprogs.git LU-8465 ext2fs: RO open for bitmap loading See following errors: e2fsck -fnm 12 /dev/loop0 Multiple threads triggered to read bitmaps e2fsck: Operation not permitted while retrying to read bitmaps for 35df4c2c-MDT0000 snapshot device is Readonly, open it with RW will return EPERM, since parallel bitmap loading is Readonly operation, use readonly open is ok. Fixes: 0e888c3cca ("LU-8465 ext2fs: parallel bitmap loading") DDN-bug-id: EX-2665 Change-Id: I3e5fc1f9360d714f8223b5628aab871b0ac25298 Signed-off-by: Wang Shilong Reviewed-on: https://review.whamcloud.com/43129 Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/lib/ext2fs/rw_bitmaps.c b/lib/ext2fs/rw_bitmaps.c index b66ba77..0cc0f92 100644 --- a/lib/ext2fs/rw_bitmaps.c +++ b/lib/ext2fs/rw_bitmaps.c @@ -592,7 +592,7 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) thread_infos[i].rbt_grp_end = fs->group_desc_count - 1; else thread_infos[i].rbt_grp_end = average_group * (i + 1); - retval = manager->open(fs->device_name, IO_FLAG_RW, + retval = manager->open(fs->device_name, 0, &thread_infos[i].rbt_io); if (retval) break;