Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2955055rwb; Fri, 2 Dec 2022 18:41:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf5U0TaxRpEzNLc2rpzMm44hKT9xhIO3dKqczQt/+F6NMR6YEE2+GQPv8hbbTy3BKeb/v+ac X-Received: by 2002:a17:902:e8d5:b0:186:a636:b135 with SMTP id v21-20020a170902e8d500b00186a636b135mr67409850plg.93.1670035261789; Fri, 02 Dec 2022 18:41:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670035261; cv=none; d=google.com; s=arc-20160816; b=Oq8EJYUr9cL0/S7HxdVDLDr481jMtOPHwsDh3HB2EDRxEbT2UDf+QvKMRd13BhnzWv zfuU7zqdV4F+vhCu2mggVnlEbd1v8JxglJ+zMysaVEucDDQsfMEHV2GHh4SYzuugKA9X Ix753gvzmpgE55BrodXQPDuGJrGb2ZYVVfdjwV/3UMq0GcZt25gvYk9PgicKQcTDZhR6 zU57LnC5lg7XePsMdl7hC8gvVSygeBEgUWFTuNn0cVdCXn4mjGJb4RYxboE0cJeILkFm tht4bzIbljWLHPdmfYOTE8um8qy6dkm6yceDrpYGa2CUego04ucAxTyIUEQKg5m7CGfK RHEA== 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=9G36o5uhkNdsh1Nk5gHzavXKrZOSTqff138oxLNw6bI=; b=UPPmjXkZr+bl0mDNBJb5uDkWHw0G6iBxcLCfMB+HYHC0gMqxOfl6f43f7HAiQMqTqR gmfSy+Vp9HD1dVlugJCu83e7E30BRCrOOIO/nbYS4uI7IHNj4LR24L+nVemSVkROMlel 85jY7ADFS3ay7y6q3v6yS3VjKByzvae68+iXvvLDx80e68rBbn18FZ5eRgWRFm8kmj8j UDcnANnGNEcKLDqkO67TaunGyDMlJU8fJS0zLFry2C/YxstyXOZxWSeKmeh5T5rg4aJJ bNe6Nw9uy8glkGZozLJehPqqOpSl9Bxgbjfq6cduPy9cY9/tr4Rlpvv2GDndgytiRcoR jlyA== 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 w189-20020a6382c6000000b00476fc220c97si9053365pgd.648.2022.12.02.18.40.49; Fri, 02 Dec 2022 18:41:01 -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 S235202AbiLCCis (ORCPT + 99 others); Fri, 2 Dec 2022 21:38:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235194AbiLCCip (ORCPT ); Fri, 2 Dec 2022 21:38:45 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69A11EC09E; Fri, 2 Dec 2022 18:38:44 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4NPDWy5TLjz4f3k5x; Sat, 3 Dec 2022 10:38:38 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP4 (Coremail) with SMTP id gCh0CgDXSNavtopjXug+Bg--.58501S6; Sat, 03 Dec 2022 10:38:41 +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 v3 2/3] ext4: record error when detect abnormal 'i_reserved_data_blocks' Date: Sat, 3 Dec 2022 10:59:40 +0800 Message-Id: <20221203025941.2661302-3-yebin@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221203025941.2661302-1-yebin@huaweicloud.com> References: <20221203025941.2661302-1-yebin@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgDXSNavtopjXug+Bg--.58501S6 X-Coremail-Antispam: 1UD129KBjvdXoW7GF1DXr1UJFW8Zr17uF13XFb_yoWkGrgEqw 40yF10v3yfZw4Igan5Gr13JFZYkF4kCr18Gw1rKF15Zr1YvF4DCw4DAry3Arn5Way8Grn0 9rWrJry3JrWrWjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbV8YFVCjjxCrM7AC8VAFwI0_Xr0_Wr1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r15M2 8IrcIa0xkI8VCY1x0267AKxVW8JVW5JwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK 021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r 4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx 0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWU JVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJV W8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF 1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6x IIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvE x4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvj DU0xZFpf9x07jeWlkUUUUU= 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 840e0a614959..41413338c05b 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) -- 2.31.1