From patchwork Tue Nov 17 11:29:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Holger_Hoffst=C3=A4tte?= X-Patchwork-Id: 7635581 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 81A0C9F2EC for ; Tue, 17 Nov 2015 11:29:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A3002204D6 for ; Tue, 17 Nov 2015 11:29:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C3514204FC for ; Tue, 17 Nov 2015 11:29:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751223AbbKQL3f (ORCPT ); Tue, 17 Nov 2015 06:29:35 -0500 Received: from static.68.134.40.188.clients.your-server.de ([188.40.134.68]:50468 "EHLO mail02.iobjects.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751103AbbKQL3e (ORCPT ); Tue, 17 Nov 2015 06:29:34 -0500 Received: from tux.wizards.de (p4FF582A1.dip0.t-ipconnect.de [79.245.130.161]) by mail02.iobjects.de (Postfix) with ESMTPSA id E8C8F416015E; Tue, 17 Nov 2015 12:29:32 +0100 (CET) Received: from [192.168.100.223] (ragnarok [192.168.100.223]) by tux.wizards.de (Postfix) with ESMTP id 7DEAE11C0066; Tue, 17 Nov 2015 12:29:32 +0100 (CET) To: linux-btrfs Cc: David Sterba , Chris Mason From: =?UTF-8?Q?Holger_Hoffst=c3=a4tte?= Subject: [PATCH] Fix balance regression in 4.4-rc X-Enigmail-Draft-Status: N1110 Organization: Applied Asynchrony, Inc. Message-ID: <564B0F9C.6060707@googlemail.com> Date: Tue, 17 Nov 2015 12:29:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Fixes: bc3094673f22 ("btrfs: extend balance filter usage to take minimum and maximum") Reviewed-by: Filipe Manana --- -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 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;