diff options
author | Josef Bacik <josef@toxicpanda.com> | 2021-11-05 23:45:47 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-01-03 17:09:49 +0300 |
commit | 056c83111648a92233f0445bb4a6c1aeafe6be98 (patch) | |
tree | 3ecf993849b50b264139c3098bce90a23b956f7e /fs/btrfs/file-item.c | |
parent | 84d2d6c7016513f59d98da30da486af3f5244b04 (diff) | |
download | linux-056c83111648a92233f0445bb4a6c1aeafe6be98.tar.xz |
btrfs: set BTRFS_FS_STATE_NO_CSUMS if we fail to load the csum root
We have a few places where we skip doing csums if we mounted with one of
the rescue options that ignores bad csum roots. In the future when
there are multiple csum roots it'll be costly to check and see if there
are any missing csum roots, so simply add a flag to indicate the fs
should skip loading csums in case of errors.
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/file-item.c')
-rw-r--r-- | fs/btrfs/file-item.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index 3acc8b2b5b84..2517b0050b99 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c @@ -376,7 +376,8 @@ blk_status_t btrfs_lookup_bio_sums(struct inode *inode, struct bio *bio, u8 *dst const unsigned int nblocks = orig_len >> fs_info->sectorsize_bits; int count = 0; - if (!fs_info->csum_root || (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM)) + if ((BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM) || + test_bit(BTRFS_FS_STATE_NO_CSUMS, &fs_info->fs_state)) return BLK_STS_OK; /* |