All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix balance regression in 4.4-rc
@ 2015-11-17 11:29 Holger Hoffstätte
  2015-11-18  0:02 ` Duncan
  2015-11-20 16:09 ` Filipe Manana
  0 siblings, 2 replies; 3+ messages in thread
From: Holger Hoffstätte @ 2015-11-17 11:29 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba, Chris Mason

There's a regression in 4.4-rc since commit bc3094673f22
(btrfs: extend balance filter usage to take minimum and maximum) in that
existing (non-ranged) balance with -dusage=x no longer works; all chunks
are skipped.

After staring at the code for a while and wondering why a non-ranged
balance would even need min and max thresholds (..which then were not
set correctly, leading to the bug) I realized that the only problem
was the fact that the filter functions were named wrong, thanks to
patching copypasta. Simply renaming both functions lets the existing
btrfs-progs call balance with -dusage=x and now the non-ranged filter
function is invoked, properly using only a single chunk limit.

Signed-off-by: Holger Hoffstätte <holger.hoffstaette@googlemail.com>
Fixes: bc3094673f22 ("btrfs: extend balance filter usage to take minimum and maximum")
---
--- linux-4.1.13/fs/btrfs/volumes.c	2015-11-16 22:34:27.475045363 +0100
+++ linux-4.1.13-filters/fs/btrfs/volumes.c	2015-11-17 12:08:41.308898665 +0100
@@ -3189,7 +3189,7 @@
 	return 1;
 }
 
-static int chunk_usage_filter(struct btrfs_fs_info *fs_info, u64 chunk_offset,
+static int chunk_usage_range_filter(struct btrfs_fs_info *fs_info, u64 chunk_offset,
 			      struct btrfs_balance_args *bargs)
 {
 	struct btrfs_block_group_cache *cache;
@@ -3222,7 +3222,7 @@
 	return ret;
 }
 
-static int chunk_usage_range_filter(struct btrfs_fs_info *fs_info,
+static int chunk_usage_filter(struct btrfs_fs_info *fs_info,
 		u64 chunk_offset, struct btrfs_balance_args *bargs)
 {
 	struct btrfs_block_group_cache *cache;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-20 16:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-17 11:29 [PATCH] Fix balance regression in 4.4-rc Holger Hoffstätte
2015-11-18  0:02 ` Duncan
2015-11-20 16:09 ` Filipe Manana

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.