From patchwork Tue Jan 7 02:32:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaegeuk Kim X-Patchwork-Id: 13927986 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 590ECE77188 for ; Tue, 7 Jan 2025 02:33:00 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tUzOt-0004d1-Hp; Tue, 07 Jan 2025 02:32:58 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tUzOs-0004ct-1O for linux-f2fs-devel@lists.sourceforge.net; Tue, 07 Jan 2025 02:32:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=51RqwQSSdFmCN4XI86tMGBG/P/aCj/q/L9aJyIsiFYI=; b=O6rryRYAKf6WXFbCi4I09nHyiS ldXxd05pnnh7d02h6qb+2TZKdD+8pZiPRExXFowI6ZdYwyLbOE6YVICaah1LPAComBDtNt+qRInvA eqpnr5I9XKL27BpmTJviIz+3Kn5JKj4rdJ5p+DjsZDJLVP953aJOHnqBFpmI3c2XdcrA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=51RqwQSSdFmCN4XI86tMGBG/P/aCj/q/L9aJyIsiFYI=; b=M AP7Zjm4a0BDWz90ocWi36thVrwBQD3+Ew2k3qiJIe+ObwgX8IL3zrpv8iWO0vMwBn0XEnnzhxI37O 7XB1ILe+TRgJIOWD6KwBd52tCQ6aXvH+8h2WHugQsxbzHgI5JWLuOc6yO6FoJuEl51gd7Q6+rNS0C TwBRHluvmuZUNu8A=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tUzOq-0000V7-RA for linux-f2fs-devel@lists.sourceforge.net; Tue, 07 Jan 2025 02:32:57 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 58F6B5C55A6 for ; Tue, 7 Jan 2025 02:32:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16B34C4CED2; Tue, 7 Jan 2025 02:32:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736217171; bh=d+uKXaQ5aoFSAXUvVUg8z0pyNWkqnM2vS7sjAT0OzN8=; h=From:To:Cc:Subject:Date:From; b=DAMCIkjGr7IxM3tQ7Gcl2krixhqd+t/BRBx+tVJ/sQ/Gskm2w0lfF56rcKaL69RiI mzf+BGqCZhYqQRgtLkrZQXrPHtUaNXIEzqQcCZ0ttg1DYjUGnPdy8GhgtzfQgF4Xqq p04RVrUFlPvjjgne75w7nGnu5gbmqETKD1tI6PBBD/jtoCWY8cAun03ymiz/Fma7eJ zphK1K6VEv12UB5AWlJzMA+Bt7p0ZF7Lof5G3YfgoAqabnUFMxeZBvRNWza2vA0hV+ GORXe9jw2Z0eulPy7yhYbb3590Dij9HP25usJnSdLZDp+06ztIxPPzcoNzTZAugT1M yf2/qHm0The8A== To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Date: Tue, 7 Jan 2025 02:32:48 +0000 Message-ID: <20250107023248.3702924-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog MIME-Version: 1.0 X-Headers-End: 1tUzOq-0000V7-RA Subject: [f2fs-dev] [PATCH] f2fs: don't call block truncation for aliased file X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jaegeuk Kim via Linux-f2fs-devel From: Jaegeuk Kim Reply-To: Jaegeuk Kim Cc: Jaegeuk Kim Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net This patch should avoid the below warning which does not corrupt the metadata tho. [ 51.508120][ T253] F2FS-fs (dm-59): access invalid blkaddr:36 [ 51.508156][ T253] __f2fs_is_valid_blkaddr+0x330/0x384 [ 51.508162][ T253] f2fs_is_valid_blkaddr_raw+0x10/0x24 [ 51.508163][ T253] f2fs_truncate_data_blocks_range+0x1ec/0x438 [ 51.508177][ T253] f2fs_remove_inode_page+0x8c/0x148 [ 51.508194][ T253] f2fs_evict_inode+0x230/0x76c Fixes: 128d333f0dff ("f2fs: introduce device aliasing file") Signed-off-by: Jaegeuk Kim Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu --- fs/f2fs/node.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index c04ee1a7ce57..06313e1eb884 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1274,6 +1274,12 @@ int f2fs_remove_inode_page(struct inode *inode) return err; } + /* The aliase file must be truncated successfully. */ + if (unlikely(IS_DEVICE_ALIASING(inode))) { + f2fs_put_dnode(&dn); + return 0; + } + /* remove potential inline_data blocks */ if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode))