Whamcloud - gitweb
e2fsck: merge fs flags when threads finish
authorLi Xi <lixi@ddn.com>
Sun, 8 Sep 2019 08:15:35 +0000 (16:15 +0800)
committerLi Dongyang <dongyangli@ddn.com>
Fri, 28 Apr 2023 00:43:50 +0000 (10:43 +1000)
merge fs flags properly.

E2fsprogs-commit: d4c0519725d59c9380acc828d24bc070c5bc2c03

Change-Id: I80c773bebc0e321bf2fe3b436c3f0e601b1f1b79
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass1.c

index f6fcd84..3b35dac 100644 (file)
@@ -2315,6 +2315,7 @@ static int e2fsck_pass1_merge_fs(ext2_filsys dest, ext2_filsys src)
        ext2fs_block_bitmap block_map;
        ext2_badblocks_list badblocks;
        ext2_dblist dblist;
+       int flags;
 
        dest_io = dest->io;
        dest_image_io = dest->image_io;
@@ -2322,6 +2323,7 @@ static int e2fsck_pass1_merge_fs(ext2_filsys dest, ext2_filsys src)
        block_map = dest->block_map;
        badblocks = dest->badblocks;
        dblist = dest->dblist;
+       flags = dest->flags;
 
        memcpy(dest, src, sizeof(struct struct_ext2_filsys));
        dest->io = dest_io;
@@ -2333,6 +2335,9 @@ static int e2fsck_pass1_merge_fs(ext2_filsys dest, ext2_filsys src)
        dest->dblist = dblist;
        if (dest->dblist)
                dest->dblist->fs = dest;
+       dest->flags = src->flags | flags;
+       if (!(src->flags & EXT2_FLAG_VALID) || !(flags & EXT2_FLAG_VALID))
+               ext2fs_unmark_valid(dest);
 
        if (src->icache) {
                ext2fs_free_inode_cache(src->icache);