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 From mboxrd@z Thu Jan 1 00:00:00 1970 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 B9FB8C5AC67 for ; Tue, 11 Aug 2026 07:17:17 +0000 (UTC) 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:MIME-Version:Message-ID:Date:To:Sender: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=hERWdJfsxI61B0O/KAY+aXa2BcbD8Li99DCyByN7hNw=; b=UFcCg97leYmW+ZH1sUANavUzuP LZO0zgI9S0tOkW2gWF80fnlHAdwBooFHYUF8Kgb1SztxDog3yZyE3/p6wvaXZj45Lgxe0QvZC7B+n VuRydUPHp7IkNO8KDH4oWGvSUwa1neMJ8um3l0AtMQwSCTITzN8FAf7DshSfbalhxL3Q=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1wtgjc-0003G6-ED; Tue, 11 Aug 2026 07:17:16 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1wtgjG-0003Fe-M5 for linux-f2fs-devel@lists.sourceforge.net; Tue, 11 Aug 2026 07:16:54 +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=O/q3Bkj6uidYoR8ggnMA5gsRdg+prqQDEuz93hM3wU8=; b=N+tdjQIBiVMX751EkHeXhFdMgo dKxbsl1UtYii6B2QAzZLkvyDTrHtfRnCmSNhqsvejJWB9PvMr5wfGVVsQy2cpFGnS07nI209Cn33v zqJzk+KINapesLEFNPJmUgu6GaS/A6DraiFppImcM4v8b3hENH4JVOJbqvsY5h1h4C0c=; 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=O/q3Bkj6uidYoR8ggnMA5gsRdg+prqQDEuz93hM3wU8=; b=M VQOcHQQXYQ0H/HNYGaXdc68O6WZgqG1CVT1dBqlbKbMI8gumSuQvA/p6s+qH8RNQgoL49BiDdRYcu fgCdAqe/hUvdXIG5TtSjyzLzsngI7uyYg4Q0kMgoa/5AUtob5IK5hnNjxNVcM9f95fvKh0IksD7uE VftcNQqrPA0hdt/A=; Received: from tor.source.kernel.org ([172.105.4.254]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1wtgjC-000244-Qi for linux-f2fs-devel@lists.sourceforge.net; Tue, 11 Aug 2026 07:16:54 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 2B28C600DA for ; Tue, 11 Aug 2026 07:16:45 +0000 (UTC) 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== To: jaegeuk@kernel.org 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 MIME-Version: 1.0 X-Headers-End: 1wtgjC-000244-Qi Subject: [f2fs-dev] [PATCH v5 1/2] f2fs: fix to off-by-one issue in f2fs_zero_post_eof_page() 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: , From: Chao Yu via Linux-f2fs-devel Reply-To: Chao Yu Cc: stable@kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel