Whamcloud - gitweb
libext2fs: when writing bitmaps mark the fs as dirty if necessary
authorTheodore Ts'o <tytso@mit.edu>
Mon, 1 Jan 2018 23:59:16 +0000 (18:59 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 2 Jan 2018 00:06:36 +0000 (19:06 -0500)
If any checksum fields are updated in the block group descriptors, we
need to set the EXT2_FLAG_DIRTY flag so that the block group
descriptors are written to disk.

Addresses-Debian-Bug: #883869

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/rw_bitmaps.c

index ae593d4..9db76eb 100644 (file)
@@ -94,6 +94,7 @@ static errcode_t write_bitmaps(ext2_filsys fs, int do_inode, int do_block)
                if (retval)
                        return retval;
                ext2fs_group_desc_csum_set(fs, i);
+               fs->flags |= EXT2_FLAG_DIRTY;
 
                blk = ext2fs_block_bitmap_loc(fs, i);
                if (blk) {
@@ -125,6 +126,7 @@ static errcode_t write_bitmaps(ext2_filsys fs, int do_inode, int do_block)
                if (retval)
                        goto errout;
                ext2fs_group_desc_csum_set(fs, i);
+               fs->flags |= EXT2_FLAG_DIRTY;
 
                blk = ext2fs_inode_bitmap_loc(fs, i);
                if (blk) {