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=1796384144; b=IyECgIWh+rTf4cy7yfJrZFMDwDi2W123YTzsVeTyNGuVrumdbrpHuj3Qy91R5d5lMw0Y AB/9+wq5SlaVSURzyMZB34231e/nZnyIE442WNZM7SmZKShOJqQKpNFH/OiMvmmu/Qujo G2Re/STQgsgy4s9Z6cAKxmYa5eSZD1YzP85wRCGbvECHhsPHdyzM94DzF3w1wHRcDVUoN d4xJh9QQoiNY1FKEA4nYi92DWp1kc5YF8GdJRasmcxR0iMobwk1VKQk/JNJRAfxThqhmk +CbUnr5QaLctziywb8zj3kxLOtvm3z7t2SylniWLYS+hmz/1VTv0MrNqUX2dmXHt1fA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384144; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=YitumaXUGMyzmDydBmVBx3K0qHE//oCWxVRX0cLKbuI=; b=efrG2S2FDJV2YHbryTcs1o+++UV4IAV8KWwziFsWLx+1oqW0LOHFCgHP8HeCKucMYbbU KV0QEKGNdA6p+m9r63WBKOatPRwR5neI/bLFsu1XPtkTWic5LP1GIj7/iapTsemSSyO7B c0QCgOR3domfXfgRKj4GDD+qmN/RKdz84UXJPaDIDggpMk6TPq3y95Fr/F5jiPBmqxgU2 kk897ilR588be/2cjOcFHzVxR13WxmBUY2agBIk2/fc0xCmyjV4O/ANzjbTNpNc5iuYtz MGpI7tMnBZZ8VviX20NxlgHRaYF9kBsh5gWtXHA9Ep8XRY26eeXVvskmrmNgS07UfLQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=p0n8gECp; 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 CB95D606A322; Fri, 4 Dec 2026 11:35:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=p0n8gECp Received: by smtp.kernel.org (Postfix) with ESMTPSA id 272C21F00897; Fri, 4 Dec 2026 11:35:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384144; bh=YitumaXUGMyzmDydBmVBx3K0qHE//oCWxVRX0cLKbuI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=p0n8gECpKHd0t2hJy9ZvQItFiFT34kfqwZQ1+MNDMHl3VmoCsTFQk3Ji5J7ey7nIw SXqZMfestZZVv5h/YREJwm6r0K2HTVhePselR3P360uR9F3iLmLgft55be3VfOm1qC 1M3M42yUmZlWAxuAh3sta9PcpH/Xni4ZI4+l/1EI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Matthew Wilcox (Oracle)" , Joseph Qi , Christoph Hellwig , Mark Fasheh , Joel Becker , ocfs2-devel@lists.linux.dev, Christian Brauner , Pedro Falcato , Sasha Levin Subject: [PATCH 6.12 516/555] filemap: Add folio_next_pos() Date: Fri, 4 Dec 2026 19:09:19 +0900 Message-ID: <20261204100628.464547439@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore 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 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Matthew Wilcox (Oracle) commit 4511fd86db6f8f94f8aff01044f5c69aa38f81f4 upstream. Replace the open-coded implementation in ocfs2 (which loses the top 32 bits on 32-bit architectures) with a helper in pagemap.h. Fixes: 35edec1d52c0 (ocfs2: update truncate handling of partial clusters) Signed-off-by: Matthew Wilcox (Oracle) Link: https://patch.msgid.link/20251024170822.1427218-2-willy@infradead.org Reviewed-by: Joseph Qi Reviewed-by: Christoph Hellwig Cc: Mark Fasheh Cc: Joel Becker Cc: Joseph Qi Cc: ocfs2-devel@lists.linux.dev Signed-off-by: Christian Brauner [pfalcato: ocfs2 is page-based in 6.12, use page_offset() there] Stable-dep-of: c6c9a4c1c9a1 ("mm: limit pagecache folio refcount when splicing into pipes") Signed-off-by: Pedro Falcato Signed-off-by: Sasha Levin --- fs/ocfs2/alloc.c | 2 +- include/linux/pagemap.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index f33aa48a3bc57..cb86ba1ecc804 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -6885,7 +6885,7 @@ static void ocfs2_zero_cluster_pages(struct inode *inode, loff_t start, ocfs2_map_and_dirty_page(inode, handle, from, to, page, 1, &phys); - start = (page->index + 1) << PAGE_SHIFT; + start = page_offset(page) + PAGE_SIZE; } out: if (pages) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 97e9690394dbb..aabf0de227290 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -938,6 +938,17 @@ static inline pgoff_t folio_next_index(const struct folio *folio) return folio->index + folio_nr_pages(folio); } +/** + * folio_next_pos - Get the file position of the next folio. + * @folio: The current folio. + * + * Return: The position of the folio which follows this folio in the file. + */ +static inline loff_t folio_next_pos(const struct folio *folio) +{ + return (loff_t)folio_next_index(folio) << PAGE_SHIFT; +} + /** * folio_file_page - The page for a particular index. * @folio: The folio which contains this index. -- 2.53.0