diff options
author | Josef Bacik <[email protected]> | 2021-11-05 16:45:47 -0400 |
---|---|---|
committer | David Sterba <[email protected]> | 2022-01-03 15:09:49 +0100 |
commit | 056c83111648a92233f0445bb4a6c1aeafe6be98 (patch) | |
tree | 3ecf993849b50b264139c3098bce90a23b956f7e /fs/btrfs/disk-io.c | |
parent | 84d2d6c7016513f59d98da30da486af3f5244b04 (diff) |
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 <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 1b69f8e52939..19cea74a848f 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -2482,11 +2482,16 @@ static int btrfs_read_roots(struct btrfs_fs_info *fs_info) if (!btrfs_test_opt(fs_info, IGNOREBADROOTS)) { ret = PTR_ERR(root); goto out; + } else { + set_bit(BTRFS_FS_STATE_NO_CSUMS, + &fs_info->fs_state); } } else { set_bit(BTRFS_ROOT_TRACK_DIRTY, &root->state); fs_info->csum_root = root; } + } else { + set_bit(BTRFS_FS_STATE_NO_CSUMS, &fs_info->fs_state); } /* |