From patchwork Sat Dec 3 02:59:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ye Bin X-Patchwork-Id: 29205 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1177441wrr; Fri, 2 Dec 2022 18:41:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf6qDrh1uCUAMq5LcWDcyt8fDtqb+14BUKNzoCRs9krN9slYiWb3VHNNjTiN31wiBskJ2I2p X-Received: by 2002:a63:5517:0:b0:42f:e191:2d35 with SMTP id j23-20020a635517000000b0042fe1912d35mr66737911pgb.1.1670035284736; Fri, 02 Dec 2022 18:41:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670035284; cv=none; d=google.com; s=arc-20160816; b=cO18dO02v7nF8OD2r5jHDdGLGDQfkUTF9MYlt1bCQ7gSz6M18qpMwWHPv0oQl+lbrD CGNKDuJRgexZgJX0BqEh9lW8D2yvu0m9xvMgN2KcIuLA+Ttf7PxcW7zw+JxZWDN2qMA2 pOu1oYdhF8VojOnJ5V2fdjRkya5gQE7uhBE5fz6XdCL2//LifUrdStfWSXV2YjgUq9nU ettddPWn4aBlamQaeGhicRAuEaJyk2aiPQCwB/BG42/BfhurP5HYRBj7YhkPifW4DyFY A5eFJ+/TdpI9VZu0vk7WsBe585m3UUby8XWdvBP1kBA/EGapBISwBEFgoj80VBFSNCvi jvww== 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=RjYRuV6s1q5T6UJbr4+pbtbAVSpfFx+39TyKOZZxrVBBjcz7iU7Eu/ucqYQfK/JvJq yQl43p1OH8KZ0nONRhxVEUsPGwsVKBs9Mw6+lIwCA/gAriOmuTdUarM5azxcXuRB6Ga9 OqkWqhPNLsBTvXMLyFPyNk1OJ8bWwjjOIcgQ6Khw7s2Lpio/uRrTMWQg3qjMdHLv0K+x dNZuEHGQ4DWAhkAWxEPXyTcvSIwjyxOP97t9jLJfyHK6XaYqH7eav2ROjZg0TyFJlleZ xqN7ZOQu8ECLbQ7+j68wVUQVo9zGjpcb02Kw3jHclbEO5C1SZja/bxkminjdIgcr6GEs 4Oyw== 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 bf6-20020a170902b90600b00177fd8409b7si8002855plb.73.2022.12.02.18.41.10; Fri, 02 Dec 2022 18:41:24 -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 S235247AbiLCCiy (ORCPT + 99 others); Fri, 2 Dec 2022 21:38:54 -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 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751158918797368790?= X-GMAIL-MSGID: =?utf-8?q?1751158918797368790?= 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 Reviewed-by: Eric Whitney --- 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)