From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796112777; b=sS3/Qxlcku2tNEkQ0SKBxQqT1ew6CKQYV100tm5g/CiLKUw+7cejdMne+GzWNiCsZb1E iBTfM7TAdEu3AMJYVPDouTVH8av2DXH7l1TB1n3Fy2Ow1OuqQCMRMt/ABBEoeH21jU5bL CvrdUmDWd/5G82C3+Wl2fWH1bN1o/aAHVL6v52OQ0eCz7+4S80xuPXAsCvfNYfhifQQqb RZ5MA+Coy70MHWMBWHIlcsnK2ngOH5RipGdNPwNV5iWrCF5CA4E47wsz++tdVZaG+7Tpj +JXuV0p+xruwqGT39fkYkXhMgTSNckotLsYpdHGcjkMsJ+B6a+s2o95j9vUE95000zw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796112777; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent:Cc: Subject:To:References:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=mU+jqEd1PQhzeWJmqxGtMJANDCtUkqxYN+zj/RUBeeM=; b=mLRM4fldcf1s/c7qONYt4i7Qg03jAy50anibXlaGPY1C9CUNGIEJnTUTr/0hIufnktL1 of9UuKzBROx0y+89b7Iyo55g83X1NVBQX8FhTpN91ykSKP9yv+SyBd9xS1axd1P8hpYFR 3hXEl29yqt7sonCGlpwWeTP5Uzt7VNgkC5vZb+iZ5l/V1k4VbSJHBTI0vXFjXdiJENXJT Jhu2W3u6AcpDxHgPdPFntVyS2vNUa6IOCbVx3vsGjQElGdYJtugLd8sZ2pIuTLYVJ0n76 /oOjZYU/Yy2UneL1B64/PaMXcNaoxaqRCbVCWzo651bc6AXOvZm/D9bP+6eyYmXwmqg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=YkpnQW2h; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBA13606A31A; Tue, 1 Dec 2026 08:12:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=YkpnQW2h Received: by smtp.kernel.org (Postfix) with ESMTPSA id C28A01F00925; Tue, 1 Dec 2026 08:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796112777; bh=mU+jqEd1PQhzeWJmqxGtMJANDCtUkqxYN+zj/RUBeeM=; h=Date:Cc:Subject:To:References:From:In-Reply-To; b=YkpnQW2h0UR/Co4pswXoGa3rVXHJtr98FMrgeIh/eotXHA/Q5ec0B//TwuCx0sz35 8u3hsfur+MDi8YNm5orPkNQeK5yON+kq2JawuIP1u2Vt/5EOYBQ2TiPKw8NvFpO+6V rchq1YhXe7eBP+QAiZwkp31PG54Jmk4DTTuFnPC+e4QX5GRwyWk7imxOoTaHjJ6JKB DJz3bSKfkqx5jTWxWsLNhEKBx2VBE0uQiNEk3ZI3WIJYh8AmFmWLnRRLMkcQnazIJL 6nyDu7evATD/B7pH5wf2yYwMuU3hxnjfrtztKpH9V3zBqrahtCoQbV3VgXpEUY90EU OJp6v5Tg3QCnQ== Message-ID: Date: Tue, 1 Dec 2026 16:12:54 +0800 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: chao@kernel.org, yangguikun19@qq.com, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, zhanxusheng@xiaomi.com, stable@vger.kernel.org Subject: Re: [PATCH] f2fs: don't BUG_ON an inconsistent node ino in roll-forward recovery To: Zhan Xusheng , jaegeuk@kernel.org References: <20261125073956.2927907-1-zhanxusheng1024@gmail.com> Content-Language: en-US From: Chao Yu In-Reply-To: <20261125073956.2927907-1-zhanxusheng1024@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11/25/26 15:39, Zhan Xusheng wrote: > From: Zhan Xusheng > > do_recover_data() asserts that the ino in the NAT entry of the node it > recovers into matches the ino in the footer of the fsynced node block. > Both are read from disk and nothing checks one against the other > before, so mounting an image with a wrong ino in that NAT entry hits > the f2fs_bug_on(): a kernel BUG with CONFIG_F2FS_CHECK_FS, and without > it a warning, after which the NAT ino is written into the footer of the > recovered node. > > To reproduce, create a file, sync, write and fsync it, crash, and change > the ino of the file's entry in the NAT journal of the checkpoint pack. > The next mount gives: > > kernel BUG at fs/f2fs/recovery.c:698! > > Fail the recovery with -EFSCORRUPTED instead, as the ofs_of_node check > right after it does. > > Reported-by: Guikun Yang > Closes: https://lore.kernel.org/all/tencent_5CEF90115E2715D386A8349FCA28D7D4D607@qq.com/ > Cc: stable@vger.kernel.org > Signed-off-by: Zhan Xusheng Reviewed-by: Chao Yu Thanks, From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CE95606A32A for ; Tue, 1 Dec 2026 08:13:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lists.sourceforge.net header.i=@lists.sourceforge.net header.a=rsa-sha256 header.s=beta header.b=Od7CwVFd; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.a=rsa-sha256 header.s=x header.b=HeVRy5ct; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.a=rsa-sha256 header.s=x header.b=AEqjkW76; dkim=neutral header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=YkpnQW2h DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:In-Reply-To:References:To:MIME-Version:Date: Message-ID:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=3sb7qy9dk0IphnmIBpYv1XijWXM9k9kLYsQyM+61DTU=; b=Od7CwVFdPddihZ 07Wj6hRwTEmEghvto0XGyNTPOZW6JVV42xHx2oko1BISasxfyZzaJ8QPRO9raLRukTfBkeZFh15Pm sQmC691iSM0BSqBzMmqQfyifUf6Ebf6O8WG7++Hw6OT2DybOeni+gLNyFr1MPXUePhXAJp6FaQSkB jyI=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.100.1) (envelope-from ) id 1xYIz4-000000002E4-0N8K; Tue, 01 Dec 2026 08:13:06 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xYIz3-000000002Dq-09VG for linux-f2fs-devel@lists.sourceforge.net; Tue, 01 Dec 2026 08:13:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: From:References:To:Subject:Cc:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mU+jqEd1PQhzeWJmqxGtMJANDCtUkqxYN+zj/RUBeeM=; b=HeVRy5ctx1TMxQ//z5FTv6vNp4 BIsp0ymMKO9k09QsktvFi6Yzcx8tLG1CJd7NzNjbD0Qr3OLJar3mqxq0wuX9JSeARLOr6NR9b4Zy9 nawwQ4vKm9Aoe3wRulm4/ZJ35w83h/RI4XI7wFsavWstZsMMkvmLgdEibl9Dc0nZ9InQ=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:To: Subject:Cc:MIME-Version:Date:Message-ID:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=mU+jqEd1PQhzeWJmqxGtMJANDCtUkqxYN+zj/RUBeeM=; b=AEqjkW76iUWnOUu0vz0a0RBnr0 H8vzNimZHSwTEJcIfiulfRVMnarjGBHseVg3q4LHgn8qXNalkfYmru71ZvVe2bw8wCfulDwrLEdj8 d7dtdAJ+qSKJWIXLP82mTsMsZLqh66dY6eGOwj8GgMTv8Z+WyY5tj2fa3sWi8qq83h+0=; Received: from tor.source.kernel.org ([172.105.4.254]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1) id 1xYIz1-000000003yq-2K1f for linux-f2fs-devel@lists.sourceforge.net; Tue, 01 Dec 2026 08:13:04 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id C8A5662129; Tue, 1 Dec 2026 08:12:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C28A01F00925; Tue, 1 Dec 2026 08:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796112777; bh=mU+jqEd1PQhzeWJmqxGtMJANDCtUkqxYN+zj/RUBeeM=; h=Date:Cc:Subject:To:References:From:In-Reply-To; b=YkpnQW2h0UR/Co4pswXoGa3rVXHJtr98FMrgeIh/eotXHA/Q5ec0B//TwuCx0sz35 8u3hsfur+MDi8YNm5orPkNQeK5yON+kq2JawuIP1u2Vt/5EOYBQ2TiPKw8NvFpO+6V rchq1YhXe7eBP+QAiZwkp31PG54Jmk4DTTuFnPC+e4QX5GRwyWk7imxOoTaHjJ6JKB DJz3bSKfkqx5jTWxWsLNhEKBx2VBE0uQiNEk3ZI3WIJYh8AmFmWLnRRLMkcQnazIJL 6nyDu7evATD/B7pH5wf2yYwMuU3hxnjfrtztKpH9V3zBqrahtCoQbV3VgXpEUY90EU OJp6v5Tg3QCnQ== Message-ID: Date: Tue, 1 Dec 2026 16:12:54 +0800 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Zhan Xusheng , jaegeuk@kernel.org References: <20261125073956.2927907-1-zhanxusheng1024@gmail.com> Content-Language: en-US In-Reply-To: <20261125073956.2927907-1-zhanxusheng1024@gmail.com> X-Spam-Score: -0.2 (/) X-Headers-End: 1xYIz1-000000003yq-2K1f Subject: Re: [f2fs-dev] [PATCH] f2fs: don't BUG_ON an inconsistent node ino in roll-forward recovery X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , From: Chao Yu via Linux-f2fs-devel Reply-To: Chao Yu Cc: zhanxusheng@xiaomi.com, linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, yangguikun19@qq.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On 11/25/26 15:39, Zhan Xusheng wrote: > From: Zhan Xusheng > > do_recover_data() asserts that the ino in the NAT entry of the node it > recovers into matches the ino in the footer of the fsynced node block. > Both are read from disk and nothing checks one against the other > before, so mounting an image with a wrong ino in that NAT entry hits > the f2fs_bug_on(): a kernel BUG with CONFIG_F2FS_CHECK_FS, and without > it a warning, after which the NAT ino is written into the footer of the > recovered node. > > To reproduce, create a file, sync, write and fsync it, crash, and change > the ino of the file's entry in the NAT journal of the checkpoint pack. > The next mount gives: > > kernel BUG at fs/f2fs/recovery.c:698! > > Fail the recovery with -EFSCORRUPTED instead, as the ofs_of_node check > right after it does. > > Reported-by: Guikun Yang > Closes: https://lore.kernel.org/all/tencent_5CEF90115E2715D386A8349FCA28D7D4D607@qq.com/ > Cc: stable@vger.kernel.org > Signed-off-by: Zhan Xusheng Reviewed-by: Chao Yu Thanks, _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel