aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorGravatar David Sterba <dsterba@suse.com> 2024-01-24 17:23:11 +0100
committerGravatar David Sterba <dsterba@suse.com> 2024-03-04 16:24:48 +0100
commit53e4d8c29095f169be2b1593bff8e4feb44ce94e (patch)
treed147ae83fe5e4ea3552d21027110797f6df57690 /fs
parentbtrfs: change BUG_ON to assertion when verifying root in btrfs_alloc_reserved... (diff)
downloadlinux-53e4d8c29095f169be2b1593bff8e4feb44ce94e.tar.gz
linux-53e4d8c29095f169be2b1593bff8e4feb44ce94e.tar.bz2
linux-53e4d8c29095f169be2b1593bff8e4feb44ce94e.zip
btrfs: change BUG_ON to assertion in reset_balance_state()
The balance state machine is complex so it's good to verify the assumptions in helpers, however reset_balance_state() is used at the end of balance and fs_info::balance_ctl is properly set up before and protected by the exclusive op ownership in btrfs_balance(). Reviewed-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/volumes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 56b0b167e386..4ad9eca9b46c 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -3632,7 +3632,7 @@ static void reset_balance_state(struct btrfs_fs_info *fs_info)
struct btrfs_balance_control *bctl = fs_info->balance_ctl;
int ret;
- BUG_ON(!fs_info->balance_ctl);
+ ASSERT(fs_info->balance_ctl);
spin_lock(&fs_info->balance_lock);
fs_info->balance_ctl = NULL;