From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 545BF81732 for ; Sun, 9 Aug 2026 01:19:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786238361; cv=none; b=CPGYieElQbOUsywF+/49OOimFZO7KxouL82AmFbbiKbxonNBmyVw9ahs1z96Ucojs4B1nUz9e9CqiJBCrRwS/z3TOJy7ig4zaNlWJuEVqMKBWqxBy2/JhZdjpkCuXWfC+lZF3GaTsvPJKI75fSLWP/a5MQNAHBbOHo32/+oT9T8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786238361; c=relaxed/simple; bh=nliZGGqoTf8L9wkjrQ6O7QQvyL7s0+Fryab7vJKLAFo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rykrfmmvzcnQ5vWSE3XbwEsCEXXQ15OQzwuj+Ena54ZaXZRwuFVxKFEW6t+AY2ykyYya8667k1HlCabJKZw1lRmREIJ0940UXIrvzgZ0JIsXKNkUErnk4BhWZG3zc8IjDZy0xEM8apFcqo86gh1ugRTr4pvsXWZDaKb+kSSxaTI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=d4AaF0uX; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="d4AaF0uX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAC3D1F000E9; Sun, 9 Aug 2026 01:19:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786238359; bh=K2qNCO2iIrsvq5WO9N3ClCvHMyYMh9h8fqOjkEzr0nA=; h=From:To:Cc:Subject:Date; b=d4AaF0uXDoT8SCQOQr/zkNtkYEWXAP+45hT/reQC37zlf5qRm9mV3KynMZspGTpCN /ICvgdGOui9xVPMnfpEglkK0g10xJR+aWZcImuITURJtQJ6HDarSrFSB1cgTqDC17y UZqSuL9CXgYBPA+eSVBTmimu0wlyucXJyFo92gf76a1iYKMzBjzlwf0r84RKeDG6qN uwqqD9R4YD3bIr2k5xYSgPJcAZqKZK4Q28suDixJF2oJalZyenWAsHIZrrrvYGsoqw UGKRy0i46KJAKUIk0Qjd3BV2wS83OjhghgIFGwES790VpFcRYDFcgeaEyrV5ikyi8i 8ju0xptuE1LrA== From: Chao Yu To: jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu , stable@kernel.org Subject: [PATCH v4 1/2] f2fs: fix to off-by-one issue in f2fs_zero_post_eof_page() Date: Sun, 9 Aug 2026 09:19:13 +0800 Message-ID: <20260809011914.565936-1-chao@kernel.org> X-Mailer: git-send-email 2.55.0.654.g21b8a5bc05-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Otherwise, it will drop one more page after new_size which is not necessary. Cc: stable@kernel.org Fixes: ba8dac350faf ("f2fs: fix to zero post-eof page") Signed-off-by: Chao Yu --- v4: - no changes fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index b99d9cdf9ba7..be319a2e9830 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -50,7 +50,7 @@ static void f2fs_zero_post_eof_page(struct inode *inode, if (lock) filemap_invalidate_lock(inode->i_mapping); /* zero or drop pages only in range of [old_size, new_size] */ - truncate_inode_pages_range(inode->i_mapping, old_size, new_size); + truncate_inode_pages_range(inode->i_mapping, old_size, new_size - 1); if (lock) filemap_invalidate_unlock(inode->i_mapping); } -- 2.49.0