OSDN Git Service

btrfs: allow device add if balance is paused
authorNikolay Borisov <nborisov@suse.com>
Thu, 25 Nov 2021 09:14:43 +0000 (11:14 +0200)
committerDavid Sterba <dsterba@suse.com>
Fri, 7 Jan 2022 13:18:23 +0000 (14:18 +0100)
commita174c0a2e857081195db6888323802f0fae793ef
tree24a0b208fe8d74414fca325b8f291588b748a1e1
parent621a1ee1d399c77dd4604aeab3e0f6319f649dbc
btrfs: allow device add if balance is paused

Currently paused balance precludes adding a device since they are both
considered exclusive ops and we can have at most one running at a time.
This is problematic in case a filesystem encounters an ENOSPC situation
while balance is running, in this case the only thing the user can do
is mount the fs with "skip_balance" which pauses balance and delete some
data to free up space for balance. However, it should be possible to add
a new device when balance is paused.

Fix this by allowing device add to proceed when balance is paused.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c