Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4111547rwb; Mon, 21 Nov 2022 04:00:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf6xjTxDCCYgZUJJrj82815FeyISy1iID4AqMzDwSA6BTnTPZiD0v9nAAYURvWTQvav12zLo X-Received: by 2002:a17:902:e0d1:b0:188:4f8b:dc59 with SMTP id e17-20020a170902e0d100b001884f8bdc59mr1840657pla.50.1669032038623; Mon, 21 Nov 2022 04:00:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669032038; cv=none; d=google.com; s=arc-20160816; b=JXplpLZYpg5UP+oFhQS/lg4SpwH9t26FZeTycYaMUmRFOjpuqGnaA5rqIOhAdl8Q5M YFFTYWrAIa/u/TqcyWGHBNNDp2k1dJyHBqjXSolv6sk1Sq0FA74CpJPULW+KqbktTLt2 atkUB9glpNKdwB/2/UazgOilYW/TRMLbt1CfYpXSuVjBHS3Oj5BUUcSooQU1MSBjHxkI vKAmrduObrm6DSo+UNW7Y8nI3hJdGEYcvKGovZ1+BcNi7L2SSRXUiyUYJJMzH/qaElsk 402bCQAPtMkac8HvT/zpM/eLgeERuWR18aiSOZjSKCn/EGDC/dqoULPQFX2RHnY7RTop /Ztg== 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=wiAY+1K8Z9ylpqt90PubTo1c3ZvsMx2qqme5hyeoqOc=; b=FApIukEt1t1ARfUe8TAAGqlIu+jSKdij10e3I6+rCtqPzjWsVZ8ZZSdHmBJlDfbxh6 089uPi6OcittZo87ibmnq/DWQ/Wn3SrK2PzHfXVoGJ/yNGRsnkM8B6hErHlAWNTN45di u7kEG9aopK1CbAsnzr+58WWbKmLiG9X+mukYCcwKtw9uxGPZUYUFGKVJIiQVPgvjLG5M HBnpur94YXaqhnl7wECT4iZNLLtCdcaUVOgxTn/jTf/5Mep5kQ6oMLtzRJxJRQQJ0UuF elRadJ0DOzkZKv1B0U3eOcBaYpZgEPkZrNdKNF9az+ZjDGpIyJz/OOBPperpjH97eQh0 1+xQ== 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 s83-20020a632c56000000b0047702d15bcesi11917618pgs.42.2022.11.21.04.00.19; Mon, 21 Nov 2022 04:00:38 -0800 (PST) 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 S230083AbiKULx2 (ORCPT + 99 others); Mon, 21 Nov 2022 06:53:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229903AbiKULxX (ORCPT ); Mon, 21 Nov 2022 06:53:23 -0500 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFDAF165B2; Mon, 21 Nov 2022 03:53:22 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4NG5PS4wjJz4f3jYt; Mon, 21 Nov 2022 19:53:16 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP4 (Coremail) with SMTP id gCh0CgDHONatZntj0uehAw--.51112S6; Mon, 21 Nov 2022 19:53:19 +0800 (CST) From: Ye Bin To: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org Cc: linux-kernel@vger.kernel.org, jack@suse.cz, Ye Bin Subject: [PATCH v2 2/3] ext4: record error when detect abnormal 'i_reserved_data_blocks' Date: Mon, 21 Nov 2022 20:14:33 +0800 Message-Id: <20221121121434.1061725-3-yebin@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221121121434.1061725-1-yebin@huaweicloud.com> References: <20221121121434.1061725-1-yebin@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgDHONatZntj0uehAw--.51112S6 X-Coremail-Antispam: 1UD129KBjvdXoW7GF1DXr1UJFW8Zr17uF13XFb_yoWkGrbEqw 40yF10v393Xw4xWFs5GrnxJFsYkF4kCr18Ww4rKF15Zr1jvF4DAw4kAry7Zrn5Way8Grn0 9rWfJry3GrWrWjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbVxYFVCjjxCrM7AC8VAFwI0_Xr0_Wr1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r15M2 8IrcIa0xkI8VCY1x0267AKxVW8JVW5JwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK 021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r 4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx 0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWU JVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJV W8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF 1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6x IIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvE x4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJbIYCTnIWIevJa 73UjIFyTuYvjxU2_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: X-Mailing-List: linux-ext4@vger.kernel.org From: Ye Bin 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 --- fs/ext4/super.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 0690e2e0b74d..3d30007502a4 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1387,10 +1387,9 @@ 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) -- 2.31.1