ext4: don't update checksum of new initialized bitmaps
authorTheodore Ts'o <tytso@mit.edu>
Mon, 19 Feb 2018 19:16:47 +0000 (14:16 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 29 Apr 2018 05:45:27 +0000 (07:45 +0200)
commitab3fc66b3dc8bcd9e15ce9ed48cde061f564f6ee
treed5203e124a7efa56d13302b6284c283f4be794bf
parent802ec698e07b01426f044fdd5d612570a0c22b33
ext4: don't update checksum of new initialized bitmaps

commit 044e6e3d74a3d7103a0c8a9305dfd94d64000660 upstream.

When reading the inode or block allocation bitmap, if the bitmap needs
to be initialized, do not update the checksum in the block group
descriptor.  That's because we're not set up to journal those changes.
Instead, just set the verified bit on the bitmap block, so that it's
not necessary to validate the checksum.

When a block or inode allocation actually happens, at that point the
checksum will be calculated, and update of the bg descriptor block
will be properly journalled.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
Signed-off-by: Harsh Shandilya <harsh@prjkt.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/balloc.c
fs/ext4/ialloc.c