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 9651147DFBE; Thu, 20 Aug 2026 17:29:47 +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=1787246988; cv=none; b=azELjZ4iJFStCXIunK259SC6BlrgouKTyie9JpKvv3yW9rraIGOvZT19i5xF5sehSpXfYbEzZuIgmJ2bXZPvcTX7pjCjoUZqVKHDlZld5It9KH+bxA9jQewbjixXafGh578p9oFEz1getuxzN1McgGrVycej+U5f46M6p6J+Sc8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787246988; c=relaxed/simple; bh=6qfFJqmPkX9DeS/b2uTDOrDjhqgQTmuaBEQDnsMaljU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jNT96wN7Hr0lzwnEfqEmDr7z5a/r45v1EhQkMaxdDzvqICb8q8zLENmCLA1bJpYicoRnswMjH1cq1YHakQi+fZthuH+B/sfGZ0JfqKajSR7uJbprxF25QAKL0mT8EHFswaylZS7Nbq0iiRsy9zbbFLSeotD7YaZHebB3ofXlSgo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Y+DTiZRj; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Y+DTiZRj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 962781F00A3A; Thu, 20 Aug 2026 17:29:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787246987; bh=gjnbZjB1tieF6yEq0sW0C4x0aHs0D7ei48EkP/a31E8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Y+DTiZRjiHPZoE7+CUqo2Byoz/DP2rXo6+VwwrELEK2MH8JzAmW+NZ0YG6yUsGJns fTCP/kZwcMx21Mg3bkGAM7nNR3LXJonIC/kWjdjgu8yO9ms5Okp9jt4RTArb5Mkpt4 RBbDPeaUGcn+tToYRZG3uGyVXPWZd8JjSke9W8z0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Matthew Wilcox (Oracle)" , Viacheslav Dubeyko , Christian Brauner , Sasha Levin Subject: [PATCH 6.12 111/220] ceph: Remove ceph_writepage() Date: Thu, 20 Aug 2026 16:55:01 +0200 Message-ID: <20260820145226.810571318@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260820145223.480031205@linuxfoundation.org> References: <20260820145223.480031205@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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)" [ Upstream commit 19a288110435408fcf2cb274823f2a17d03caf9b ] Ceph already has a writepages operation which is preferred over writepage in all situations except for page migration. By adding a migrate_folio operation, there will be no situations in which ->writepage should be called. filemap_migrate_folio() is an appropriate operation to use because the ceph data stored in folio->private does not contain any reference to the memory address of the folio. Signed-off-by: "Matthew Wilcox (Oracle)" Link: https://lore.kernel.org/r/20250217185119.430193-2-willy@infradead.org Tested-by: Viacheslav Dubeyko Reviewed-by: Viacheslav Dubeyko Signed-off-by: Christian Brauner Stable-dep-of: cbf59617cd71 ("ceph: fix writeback_count leak in write_folio_nounlock()") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/ceph/addr.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -824,32 +824,6 @@ static int writepage_nounlock(struct pag return err; } -static int ceph_writepage(struct page *page, struct writeback_control *wbc) -{ - int err; - struct inode *inode = page->mapping->host; - BUG_ON(!inode); - ihold(inode); - - if (wbc->sync_mode == WB_SYNC_NONE && - ceph_inode_to_fs_client(inode)->write_congested) { - redirty_page_for_writepage(wbc, page); - return AOP_WRITEPAGE_ACTIVATE; - } - - folio_wait_private_2(page_folio(page)); /* [DEPRECATED] */ - - err = writepage_nounlock(page, wbc); - if (err == -ERESTARTSYS) { - /* direct memory reclaimer was killed by SIGKILL. return 0 - * to prevent caller from setting mapping/page error */ - err = 0; - } - unlock_page(page); - iput(inode); - return err; -} - /* * async writeback completion handler. * @@ -1598,7 +1572,6 @@ out: const struct address_space_operations ceph_aops = { .read_folio = netfs_read_folio, .readahead = netfs_readahead, - .writepage = ceph_writepage, .writepages = ceph_writepages_start, .write_begin = ceph_write_begin, .write_end = ceph_write_end, @@ -1606,6 +1579,7 @@ const struct address_space_operations ce .invalidate_folio = ceph_invalidate_folio, .release_folio = netfs_release_folio, .direct_IO = noop_direct_IO, + .migrate_folio = filemap_migrate_folio, }; static void ceph_block_sigs(sigset_t *oldset)