Skip to contentSkip to conversation

Btrfs: fix a mismerge in btrfs_balance()

PATCH In review Ilya Dryomov 2 participants 2 messages Mar 6, 2013 – Mar 7, 2013 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 fs/btrfs/volumes.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
fs/btrfs/volumes.c +5 -0
index 35bb2d4..33440da 100644
@@ -3230,6 +3230,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;
Signature · 1 line
1.7.9.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Ilya Dryomov

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.

Quoted 29 lines
---
 fs/btrfs/volumes.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
fs/btrfs/volumes.c +5 -0
index 35bb2d4..33440da 100644
@@ -3230,6 +3230,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;
Signature · 6 lines
1.7.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html