Whamcloud - gitweb
LU-8465 ext2fs: RO open for bitmap loading 29/43129/3
authorWang Shilong <wshilong@ddn.com>
Fri, 19 Mar 2021 07:31:55 +0000 (15:31 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 26 Mar 2021 20:49:10 +0000 (20:49 +0000)
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 <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/43129
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lib/ext2fs/rw_bitmaps.c

index b66ba77..0cc0f92 100644 (file)
@@ -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;