]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/ext4/balloc.c
UBUNTU: SAUCE: ext4: check for allocation block validity with block group locked
[mirror_ubuntu-bionic-kernel.git] / fs / ext4 / balloc.c
index 824c99ee213c06aca3f8be9855af52c275cc8515..95168ccec6c0636f7ba05ebad644132bb4e7d830 100644 (file)
@@ -377,6 +377,8 @@ static int ext4_validate_block_bitmap(struct super_block *sb,
                return -EFSCORRUPTED;
 
        ext4_lock_group(sb, block_group);
+       if (buffer_verified(bh))
+               goto verified;
        if (unlikely(!ext4_block_bitmap_csum_verify(sb, block_group,
                        desc, bh))) {
                ext4_unlock_group(sb, block_group);
@@ -399,6 +401,7 @@ static int ext4_validate_block_bitmap(struct super_block *sb,
                return -EFSCORRUPTED;
        }
        set_buffer_verified(bh);
+verified:
        ext4_unlock_group(sb, block_group);
        return 0;
 }