Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3187419rwd; Sat, 3 Jun 2023 00:04:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ56E4FYUUdGRUQqgiDAVBmU3FQgq2SdaXmI69FD+INHo2jfGS+fKRpl2FqHR8b866CxYhE3 X-Received: by 2002:a17:90a:310:b0:249:6098:b068 with SMTP id 16-20020a17090a031000b002496098b068mr2042739pje.45.1685775840624; Sat, 03 Jun 2023 00:04:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685775840; cv=none; d=google.com; s=arc-20160816; b=wkImQ9MWqfNYzHz3Bw+T9GUWZkZb4xfTZd7wrnS3PYahzfgpOpoGNo3vr3F7hXzpB3 85OQpHfQgbikZXqbEPPnZ/l3FpDka8rzBgz0EvZ+C1v80QmxL4i7h+svb0UBeOvp+PF2 1IwtubAWhlNXQ57wQLpXJMS5kfxPdh0cXU0rT3QP235TSc8aEqkMTqT4M3gTVTrPfthT oIGKTILIWG+xQziQlwpeNokvQQLJIht3mLWjhwPOvsRYmA8edk0dLQQqMmI1u7Z4ZyjP 7JWFysg2WcQuNpq3gjgR1VWOqlHGTN765T0k9n/q+ubhHLjnnA3adjQZt42APnn5KT05 C5eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=mcLbl58GeVYzt80Vde7Z3uP0Kc1p8PVt8r5H4xpwPm8=; b=YkH+vY8rhdDJKZkDWDakBxa9OqWfgkkDHxhGsyzBXNWPP+DaM/CZ/EIox+yy37FJ6K f3NoX4Ymw8LPmdn6f+hyErxXIvjkXm75v8h+JOn0ERVzaNljw108fCrO/NXvX+vf8OMW JPphbh8yozyRgmNnD2f5c2DLkxB0LPhP4pr9vVSFKXCcG2Wq/g0W+LQS7QFZwu+4/iMY Tg5eLkLmOnck7A3MUtdkzvDkA83Sdq5VzfRPlfFJY70dKLfejRltG5htiqryaMQdSYmS CxOUTamTLD7r+aCoJpLRrtNz0q/CmeoOd2WpRNz4Ox7ncaM4kUHXBJE72wWWlLYOBAAz sQsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cx4-20020a17090afd8400b0025653dc2881si3989868pjb.23.2023.06.03.00.03.46; Sat, 03 Jun 2023 00:04:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234077AbjFCHC2 (ORCPT + 99 others); Sat, 3 Jun 2023 03:02:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232454AbjFCHCM (ORCPT ); Sat, 3 Jun 2023 03:02:12 -0400 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15FE6C0; Sat, 3 Jun 2023 00:02:11 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4QY9lt1Ffyz4f3nqM; Sat, 3 Jun 2023 15:02:02 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgCHOKxk5Xpk+MxPKw--.30174S12; Sat, 03 Jun 2023 15:02:03 +0800 (CST) From: Kemeng Shi To: tytso@mit.edu, adilger.kernel@dilger.ca, ojaswin@linux.ibm.com Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, shikemeng@huaweicloud.com Subject: [PATCH v4 10/19] ext4: fix wrong unit use in ext4_mb_clear_bb Date: Sat, 3 Jun 2023 23:03:18 +0800 Message-Id: <20230603150327.3596033-11-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230603150327.3596033-1-shikemeng@huaweicloud.com> References: <20230603150327.3596033-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgCHOKxk5Xpk+MxPKw--.30174S12 X-Coremail-Antispam: 1UD129KBjvdXoW7Wr18Gr18XF4xCFWUXrW7twb_yoWfAFc_K3 WkAr1kGryrJwn3CFn3tw45tr98KF40yF1DXF1fKF4xW3W5XFWxu34DJrW5Arn7WF43t343 CF1fZryfAFWS9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbDAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M28IrcIa0xkI8V A2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJ M28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2I x0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK 6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4 xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8 JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20V AGYxC7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAF wI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc4 0Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r4j6ryUMIIF0xvE2Ix0cI8IcVCY1x0267AK xVWxJVW8Jr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F 4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0pRvJPtU UUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Function ext4_issue_discard need count in cluster. Pass count_clusters instead of count to fix the mismatch. Signed-off-by: Kemeng Shi Reviewed-by: Ojaswin Mujoo --- fs/ext4/mballoc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 1345c4e84cc3..474aebfdc1dd 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -6280,8 +6280,8 @@ static void ext4_mb_clear_bb(handle_t *handle, struct inode *inode, * them with group lock_held */ if (test_opt(sb, DISCARD)) { - err = ext4_issue_discard(sb, block_group, bit, count, - NULL); + err = ext4_issue_discard(sb, block_group, bit, + count_clusters, NULL); if (err && err != -EOPNOTSUPP) ext4_msg(sb, KERN_WARNING, "discard request in" " group:%u block:%d count:%lu failed" -- 2.30.0