Commit 3a01aa7a25274308fe813a6237f678aed901cea3

Authored by Ilya Dryomov
Committed by Chris Mason
1 parent 2cc65e3e57

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>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

... ... @@ -3235,6 +3235,11 @@
3235 3235 update_ioctl_balance_args(fs_info, 0, bargs);
3236 3236 }
3237 3237  
  3238 + if ((ret && ret != -ECANCELED && ret != -ENOSPC) ||
  3239 + balance_need_close(fs_info)) {
  3240 + __cancel_balance(fs_info);
  3241 + }
  3242 +
3238 3243 wake_up(&fs_info->balance_wait_q);
3239 3244  
3240 3245 return ret;