summaryrefslogtreecommitdiff
path: root/fs/btrfs/scrub.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2021-05-20 11:21:32 -0400
committerDavid Sterba <dsterba@suse.com>2021-08-23 21:54:09 +0200
commit002c0bd00afc0b1346075b1489c1e91ce1f07030 (patch)
tree52f297d061cf83fda957492cd3ad4a7cc693fde1 /fs/btrfs/scrub.c
parenta0f5d9f49712a541d7e6013aadda66814803872b (diff)
downloadlinux-next-002c0bd00afc0b1346075b1489c1e91ce1f07030.tar.gz
btrfs: add a btrfs_has_fs_error helper
We have a few flags that are inconsistently used to describe the fs in different states of failure. As of btrfs: always abort the transaction if we abort a trans handle we will always set BTRFS_FS_STATE_ERROR if we abort, so we don't have to check both ABORTED and ERROR to see if things have gone wrong. Add a helper to check BTRFS_FS_STATE_HELPER and then convert all checkers of FS_STATE_ERROR to use the helper. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r--fs/btrfs/scrub.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 088641ba7a8e..1ef301c6a63b 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -3956,7 +3956,7 @@ static noinline_for_stack int scrub_supers(struct scrub_ctx *sctx,
int ret;
struct btrfs_fs_info *fs_info = sctx->fs_info;
- if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state))
+ if (btrfs_has_fs_error(fs_info))
return -EROFS;
/* Seed devices of a new filesystem has their own generation. */