Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp807071rdb; Thu, 18 Jan 2024 22:15:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IHu14Uh/5EizTIyPLvh/WMVwJqKwhNa+m3qW18JsmDDzK3NWKE+HHEUPqsZttCZ6URz6faA X-Received: by 2002:a17:90a:6d43:b0:290:4e69:6a2 with SMTP id z61-20020a17090a6d4300b002904e6906a2mr235503pjj.82.1705644957473; Thu, 18 Jan 2024 22:15:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705644957; cv=pass; d=google.com; s=arc-20160816; b=qYjXoJPJ6T24QpitbAAq7qr98zQyZKaHtbTufcHacdMo28YwMjLIN7Go0VVjICNZzF Dmo63XBx7lMWkThjQaW8Xjyhffx3lFaI+OkMppXeE1Ax/3Rq+dnyD+610jh2Q1OFcG2g jQUQ263o3bpk3Gw4frVhzUhEfI5xr/Xjf0n9sAGzHmbV/K6/RoZM4L5JDqdrdfdEi2RF bV0xbnAOxz97T3EClEnmOvUffRG8sZU6LQ2cQuqm9VJX8vJ/IP3GLcTB8RRqLjzGh72f HarXGpEpF3apJjt6vJqwpphZgR5TCTnNUUw8JK9S9IzYf/KeJf9p21PQilKwcgWCYRdp 68cw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=tuNF+g+oixwuYq0rMmLGSfIIZ0BS+xr7yFo6+kbxly4=; fh=Uq/HK0tePPZ4uFSrjmAoQ+8fm8HBRKIYZPcFTEYnhm4=; b=OTcp9OwuyY0jNhzgCT2dtWIObKLx1VBp6b+1Z9SgCGmiBk9t+XEGPzP0ioo5n5f0sw cMGMUB0C4q3UC6HmTaZgz1L/0vYgSPYrApABndvufWaCUVPutKzHeVb4GDvIEIrNIhRJ A+KNgfhq11VvzPWJSrW1I4FyuZd8H3eJRFK/iZy0Fp8oViQYpeGOe7ZfZoNcyTuKg5lt yfaffChI7o1SehwOVMe9+fJ9guBIDf+J5bfZTTNhh2s4H0txaXjx3YrLS8W54/L/l2yl XQnuypMo7Rsh+kcAe/WEU5b08gjL4RkR0P1S0Wmby4lgQxszJEpnHiI6Gc+MbZuuO6vM q8tA== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-ext4+bounces-849-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-849-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b11-20020a655ccb000000b005cdf86014e2si2656373pgt.674.2024.01.18.22.15.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 22:15:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-849-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-ext4+bounces-849-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-849-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 97438B22894 for ; Fri, 19 Jan 2024 06:15:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B20784C6B; Fri, 19 Jan 2024 06:15:46 +0000 (UTC) X-Original-To: linux-ext4@vger.kernel.org Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2CE41392 for ; Fri, 19 Jan 2024 06:15:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705644946; cv=none; b=l8Ku8wDKVIKjcejhw6cIfM5Z2AvFHKXy3lhNQOljjgJYaJ/+TosbTSuDHIu6b+6wFJ3Flp0OPwsZvKNwkV5XzyI2S1MYFXjB9OqrrQk4Zf6XRqziPpMBiGKdKWKIjV3lwb0Q1yzt5yE00FGCjytdfvNef3W4u6vkjhCrEg8v0/g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705644946; c=relaxed/simple; bh=GcMvXiauDu7dCvok7nOP7X3bpmDO6WospztcAS1igIU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=iqT7S+oo/2XCRgqC4H9scAdLh05Wv3vPoXiweCw6Cbd7MEOIoUoYRaFjmzgbi3CAyO6OUep7ACAhIroBpGpF/cS9rGNGFdS98vzOdzGbNZ64ZZvd6r+W/pQxxW64oVGPkn64yRrjq9mDMKx+qoPV050+UiK8trR6a0cq7XQ+lwM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4TGTr257Dcz4f3jXV for ; Fri, 19 Jan 2024 14:15:30 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 7FDA71A0C30 for ; Fri, 19 Jan 2024 14:15:34 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP1 (Coremail) with SMTP id cCh0CgAn9g6CE6plcJEpBQ--.29336S4; Fri, 19 Jan 2024 14:15:34 +0800 (CST) From: Zhang Yi To: linux-ext4@vger.kernel.org Cc: tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz, yi.zhang@huawei.com, yi.zhang@huaweicloud.com, chengzhihao1@huawei.com, yukuai3@huawei.com Subject: [PATCH] ext4: add a hint for block bitmap corrupt state in mb_groups Date: Fri, 19 Jan 2024 14:11:54 +0800 Message-Id: <20240119061154.1525781-1-yi.zhang@huaweicloud.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:cCh0CgAn9g6CE6plcJEpBQ--.29336S4 X-Coremail-Antispam: 1UD129KBjvdXoW7Gr13Xr1xuF1kKF1DAF43KFg_yoWkXrb_Ca 42yF4DJryrJF18C3W8tF4YvFy8Kws7KFs5JayrtrZxuFyjqa1xXas5AF1Fka1xGrW0yrW3 ua4FgFyxWFZakjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbz8FF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j 6F4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0EwIxG rwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4 vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IY x2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26c xKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x02 67AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjfUF9a9DUUUU X-CM-SenderInfo: d1lo6xhdqjqx5xdzvxpfor3voofrz/ From: Zhang Yi If one group is marked as block bitmap corrupted, its free blocks cannot be used and its free count is also deducted from the global sbi->s_freeclusters_counter. User might be confused about the absent free space because we can't query the information about corrupted block groups except unreliable error messages in syslog. So add a hint to show block bitmap corrupted groups in mb_groups. Signed-off-by: Zhang Yi --- fs/ext4/mballoc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index d72b5e3c92ec..641c9be8e25e 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -3035,7 +3035,10 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v) for (i = 0; i <= 13; i++) seq_printf(seq, " %-5u", i <= blocksize_bits + 1 ? sg.info.bb_counters[i] : 0); - seq_puts(seq, " ]\n"); + seq_puts(seq, " ]"); + if (EXT4_MB_GRP_BBITMAP_CORRUPT(&sg.info)) + seq_puts(seq, " Block bitmap corrupted!"); + seq_puts(seq, "\n"); return 0; } -- 2.39.2