Message ID | 20221208033426.1832460-3-yebin@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp537993wrr; Wed, 7 Dec 2022 19:25:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf4vGe9WDiG0f8baNUr9moi0GEP9ft3ew1yuOHJq31unFVHvQRBZGuv2UoLFI7LkPYMxB23+ X-Received: by 2002:a65:6d95:0:b0:46f:f482:6920 with SMTP id bc21-20020a656d95000000b0046ff4826920mr66404963pgb.327.1670469933206; Wed, 07 Dec 2022 19:25:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670469933; cv=none; d=google.com; s=arc-20160816; b=ED0gwYMkwHDJqYUF5/fSnzUNROytP3TUzcLPWtHCrE3muqFExxWrMLM/vEdo4trZ4y bbQKhjtMmGWEQGAfpYCfCOZEej27PoWwb3t88ByRkq2bFavOb77wPNDmyb1vsq2hCMwy nM9K7cWIQixIAawy4SHGsDk/7rlx46MhFbxGyFfmD83tHtE1AXJLWXrFx34iwEQAq55K mouoHklpXEm3dI+VMjltWaoXRcq25MR5tPd5WazdwjuM4ba/nKoKisoOuuqHMuPxnJoY RKKigdctp5YxEcMmk0wan3BZTDKV+Bix1AoBEU8pQF7eC/LGj4v4np+py0K2gaan9uRR W6dA== 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=rnRyAvCBNuDyci1gQ3tJWkFT5u8Esr/fRn1VP9Rj5qQ=; b=pNxidTQJlmatdWXqSEMSRKTLe+ZONdiqwhd/hsTGdTYUCYJ17C4aRfrMMPPwkdsH7i pXVudOEYFFKyPWrdK+4bh/evpyPuXnqxq8CgnY2qmeIcFMZA8y4tNAiX5qG/c7evXg98 fr6ERxywwBoss6QnZNyNdTedFAbGH6RI5KmkRWvEAiZEuEEX9AWBcGEkQPWg2hwSCKId nN/PZUMxT2mbCO2s7H+pPQYe3q1YpM9cUNM8iPuDsEO1NJ9Mkpdf37O05I/v1AD6n1XI qFN0JVDs/sO9ugU58IJh8zSJC2OElBiWqP+GjRMgm5v16pKb96EGwWkx+3hwGH0Icn06 eGMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h13-20020a17090acf0d00b00219de6cb100si3159345pju.177.2022.12.07.19.25.18; Wed, 07 Dec 2022 19:25:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229714AbiLHDNo (ORCPT <rfc822;foxyelen666@gmail.com> + 99 others); Wed, 7 Dec 2022 22:13:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbiLHDNi (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 7 Dec 2022 22:13:38 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31A9570625; Wed, 7 Dec 2022 19:13:37 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4NSK3v48LTz4f3k6P; Thu, 8 Dec 2022 11:13:31 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP1 (Coremail) with SMTP id cCh0CgAn0a9cVpFjvYz4Bg--.16330S6; Thu, 08 Dec 2022 11:13:34 +0800 (CST) From: Ye Bin <yebin@huaweicloud.com> To: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org Cc: linux-kernel@vger.kernel.org, jack@suse.cz, Ye Bin <yebin10@huawei.com>, Eric Whitney <enwlinux@gmail.com> Subject: [PATCH v4 2/3] ext4: record error when detect abnormal 'i_reserved_data_blocks' Date: Thu, 8 Dec 2022 11:34:25 +0800 Message-Id: <20221208033426.1832460-3-yebin@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221208033426.1832460-1-yebin@huaweicloud.com> References: <20221208033426.1832460-1-yebin@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: cCh0CgAn0a9cVpFjvYz4Bg--.16330S6 X-Coremail-Antispam: 1UD129KBjvdXoW7GF1DXr1UJFW8Zr17uF13XFb_yoWkCFcEqw 40yF10v3yrXw4IgFs5Gr13JFZYkF4kCr18Ww1rKF15Zw1YvF4DCw4kAry3Arn5Way8Gr90 9rWrJryfXrWfWjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbskYFVCjjxCrM7AC8VAFwI0_Xr0_Wr1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r15M2 8IrcIa0xkI8VCY1x0267AKxVW8JVW5JwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK 021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r xl6s0DM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl 6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6x IIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_ Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr 1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE 14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7 IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E 87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73Uj IFyTuYvjxU2_MaUUUUU X-CM-SenderInfo: p1hex046kxt4xhlfz01xgou0bp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751614680811094026?= X-GMAIL-MSGID: =?utf-8?q?1751614680811094026?= |
Series |
Fix two issues about bigalloc feature
|
|
Commit Message
Ye Bin
Dec. 8, 2022, 3:34 a.m. UTC
From: Ye Bin <yebin10@huawei.com> If 'i_reserved_data_blocks' is not cleared which mean something wrong with code, free space accounting is likely wrong, according to Jan Kara's advice use ext4_error() to record this abnormal let fsck to repair and also we can capture this issue. Signed-off-by: Ye Bin <yebin10@huawei.com> Reviewed-by: Eric Whitney <enwlinux@gmail.com> --- fs/ext4/super.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Comments
On Thu, Dec 08, 2022 at 11:34:25AM +0800, Ye Bin wrote: > From: Ye Bin <yebin10@huawei.com> > > If 'i_reserved_data_blocks' is not cleared which mean something wrong with > code, free space accounting is likely wrong, according to Jan Kara's advice > use ext4_error() to record this abnormal let fsck to repair and also we can > capture this issue. If i_reserved_data_block, it means that there is something wrong with our delayed allocation accounting. However, this accounting is usually only an in-memory error. The one exception is if quota is enabled, in which case the space is decremented from the user/group/project quota. However, if quota is not in use, which is the overwhelmingly common case, there will be nothing for fsck to repair. (It does mean that df will show a slightly smaller free space value due to the messed up delayed allocation accounting, but that disappears after a reboot.) Marking the file system as in need of repair when nothing is actually wrong with the on-disk file system can backfire, in that it confuses users when they see the ext4 error but then when they run fsck, fsck reports nothing wrong --- at which point they file a bug. We could use ext4_error if quotas are enabled, and ext4_msg if not, but it might not worth the extra complexity. Cheers, - Ted
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 840e0a614959..4b2d257d3845 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1387,10 +1387,10 @@ static void ext4_destroy_inode(struct inode *inode) } if (EXT4_I(inode)->i_reserved_data_blocks) - ext4_msg(inode->i_sb, KERN_ERR, - "Inode %lu (%p): i_reserved_data_blocks (%u) not cleared!", - inode->i_ino, EXT4_I(inode), - EXT4_I(inode)->i_reserved_data_blocks); + ext4_error(inode->i_sb, + "Inode %lu (%p): i_reserved_data_blocks (%u) not cleared!", + inode->i_ino, EXT4_I(inode), + EXT4_I(inode)->i_reserved_data_blocks); } static void init_once(void *foo)