summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2013-03-06 09:57:55 +0100
committerChris Mason <chris.mason@fusionio.com>2013-03-07 04:03:16 +0100
commit3a01aa7a25274308fe813a6237f678aed901cea3 (patch)
tree121565712abd2b2d179548ad5dc5a1202a50593a /fs/btrfs/volumes.c
parentMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/josef/... (diff)
downloadlinux-3a01aa7a25274308fe813a6237f678aed901cea3.tar.xz
linux-3a01aa7a25274308fe813a6237f678aed901cea3.zip
Btrfs: fix a mismerge in btrfs_balance()
Raid56 merge (merge commit e942f88) had mistakenly removed a call to __cancel_balance(), which resulted in balance not cleaning up after itself after a successful finish. (Cleanup includes switching the state, removing the balance item and releasing mut_ex_op testnset lock.) Bring it back. Reported-by: David Sterba <dsterba@suse.cz> Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to '')
-rw-r--r--fs/btrfs/volumes.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 9ff454df6756..6b9cff42265d 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -3235,6 +3235,11 @@ int btrfs_balance(struct btrfs_balance_control *bctl,
update_ioctl_balance_args(fs_info, 0, bargs);
}
+ if ((ret && ret != -ECANCELED && ret != -ENOSPC) ||
+ balance_need_close(fs_info)) {
+ __cancel_balance(fs_info);
+ }
+
wake_up(&fs_info->balance_wait_q);
return ret;