From: Ilya Dryomov Date: Wed, 6 Mar 2013 08:57:55 +0000 (-0700) Subject: Btrfs: fix a mismerge in btrfs_balance() X-Git-Tag: v3.9-rc2~3^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3a01aa7a25274308fe813a6237f678aed901cea3;p=profile%2Fcommon%2Fkernel-common.git 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 Signed-off-by: Ilya Dryomov Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 9ff454d..6b9cff4 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;