Skip to content

Commit

Permalink
Btrfs: fix a mismerge in btrfs_balance()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ilya Dryomov authored and Chris Mason committed Mar 7, 2013
1 parent 2cc65e3 commit 3a01aa7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3a01aa7

Please sign in to comment.