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: stable@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,