Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.com>2016-11-03 13:16:58 +0100
committerMichal Marek <mmarek@suse.com>2016-11-03 13:16:58 +0100
commit2659fe9d134c63d2289572247e5f2e1caff03602 (patch)
tree5cbcbcfe529cac103095136cb2f6c39b828fde63
parent9464f6778611f6acbee46b9e9e277b11f53ec697 (diff)
Btrfs: fix endless loop in balancing block groups (bsc#1006804).rpm-4.4.21-81-dirty
-rw-r--r--patches.fixes/btrfs-fix-endless-loop-in-balancing-block-groups.patch39
-rw-r--r--series.conf1
2 files changed, 40 insertions, 0 deletions
diff --git a/patches.fixes/btrfs-fix-endless-loop-in-balancing-block-groups.patch b/patches.fixes/btrfs-fix-endless-loop-in-balancing-block-groups.patch
new file mode 100644
index 0000000000..c6a3a8f74c
--- /dev/null
+++ b/patches.fixes/btrfs-fix-endless-loop-in-balancing-block-groups.patch
@@ -0,0 +1,39 @@
+From: Liu Bo <bo.li.liu@oracle.com>
+Date: Wed, 31 Aug 2016 16:43:33 -0700
+Subject: Btrfs: fix endless loop in balancing block groups
+Git-commit: a9b1fc851db054ddec703dc7951ed00620600b26
+Patch-mainline: v4.8-rc5
+References: bsc#1006804
+
+Qgroup function may overwrite the saved error 'err' with 0
+in case quota is not enabled, and this ends up with a
+endless loop in balance because we keep going back to balance
+the same block group.
+
+It really should use 'ret' instead.
+
+Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
+Reviewed-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Acked-by: Jeff Mahoney <jeffm@suse.com>
+---
+ fs/btrfs/relocation.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+--- a/fs/btrfs/relocation.c
++++ b/fs/btrfs/relocation.c
+@@ -4182,9 +4182,11 @@ restart:
+ err = PTR_ERR(trans);
+ goto out_free;
+ }
+- err = qgroup_fix_relocated_data_extents(trans, rc);
+- if (err < 0) {
+- btrfs_abort_transaction(trans, rc->extent_root, err);
++ ret = qgroup_fix_relocated_data_extents(trans, rc);
++ if (ret < 0) {
++ btrfs_abort_transaction(trans, rc->extent_root, ret);
++ if (!err)
++ err = ret;
+ goto out_free;
+ }
+ btrfs_commit_transaction(trans, rc->extent_root);
diff --git a/series.conf b/series.conf
index 15a9444238..06d1aa0512 100644
--- a/series.conf
+++ b/series.conf
@@ -1846,6 +1846,7 @@
patches.suse/btrfs-8448-improve-performance-on-fsync-against-new-inode.patch
patches.suse/btrfs-fix-unexpected-balance-crash-due-to-bug_on.patch
patches.suse/btrfs-ensure-that-file-descriptor-used-with-subvol-i.patch
+ patches.fixes/btrfs-fix-endless-loop-in-balancing-block-groups.patch
# local patches, apply last
patches.suse/btrfs-provide-super_operations-get_inode_dev