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 7ED26306764 for ; Tue, 11 Aug 2026 07:16:45 +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=1786432606; cv=none; b=IBos7pLqmHtXezx6i+da29ikc3+i0+hjUS4VH0sy0makdDka5uGiL1SX+mSGg6qMbYqwvn3K7CCPrZLczsJY0dCX2m/IY4KkVWCnI7TWADHvXr7Z4QQnI3FmqJZomKungDAzjDN8ypsxm7YzRQwtwWaWaAPMAMPy/zBryA9QysQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786432606; c=relaxed/simple; bh=JU9DYQ4t30HWBPp35pCPNXUwGoQW8ZpU8pl8x3G7YKc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Dya0Sb7KeRfbYXci40gS010i+edS72SPebRUADfFW4lrcDJjj4CcbwKrpCOq3zYLw+zjmOQH+bQbu48RORAuxCP6VVdUeD2uVkwX099db2YZxu9DwW6+BMafxhGU9Rk9GFVsVs1VUIlIofRFMu/1zyjx/PG0Fqyk32B/dzTkzPw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GUw2WsVW; 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="GUw2WsVW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6B761F000E9; Tue, 11 Aug 2026 07:16:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786432604; bh=O/q3Bkj6uidYoR8ggnMA5gsRdg+prqQDEuz93hM3wU8=; h=From:To:Cc:Subject:Date; b=GUw2WsVWOwvo68eY0s0AhJjf5w1AxrDCcyDVr+IUuK8CjmDyE4fiQER+n89dLOOb7 EL1a6/ggNhYiJi9zIYppiGCNzC6dwc319n7rrhrNCUm1ilxPyzfkcZlOrdR99y4W3H AqYRMTN598B5BfCkKCCLk0+sSdlsfvMxuX3u554wIN51cedJ6gtENmhET5sfALsxCT vQ4u16PxjsVdte2THzWHxYBfwBYO/r3yY5SLt2I3DwRigdDDtLrvIGueipZJD5DS0M BXnzpRvu37z1FpOyDnraUVGoj7BHbNCnj7iT8g4UdyQZbyOQO2aUiJCetfvhDhzFP6 Ziga2/pZefe/Q== 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 v5 1/2] f2fs: fix to off-by-one issue in f2fs_zero_post_eof_page() Date: Tue, 11 Aug 2026 15:16:36 +0800 Message-ID: <20260811071637.4176024-1-chao@kernel.org> X-Mailer: git-send-email 2.55.0.691.gc56d675ccc-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 --- v5: - 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 56529a82e027..9dbe509926b2 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