All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged] swapfile-disable-swapon-for-bs-ps-devices.patch removed from -mm tree
@ 2025-05-07  1:42 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-05-07  1:42 UTC (permalink / raw)
  To: mm-commits, p.raghav, dave, da.gomez, brauner, mcgrof, akpm


The quilt patch titled
     Subject: swapfile: disable swapon for bs > ps devices
has been removed from the -mm tree.  Its filename was
     swapfile-disable-swapon-for-bs-ps-devices.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Luis Chamberlain <mcgrof@kernel.org>
Subject: swapfile: disable swapon for bs > ps devices
Date: Mon, 5 May 2025 12:35:19 -0700

Devices which have a requirement for bs > ps cannot be supported for swap
as swap still needs work.  Now that the block device cache sets the min
order for block devices we need this stopgap otherwise all swap operations
are rejected.

Without this you'll end up with errors on these devices as the swap code
still needs much love to support min order.

With this we at least now put a stop gap of its use, until the swap
subsystem completes its major overhaul:

mkswap: /dev/nvme3n1: warning: wiping old swap signature.
Setting up swapspace version 1, size = 100 GiB (107374178304 bytes)
no label, UUID=6af76b5c-7e7b-4902-b7f7-4c24dde6fa36
swapon: /dev/nvme3n1: swapon failed: Invalid argument

Link: https://lkml.kernel.org/r/aBkS926thy9zvdZb@bombadil.infradead.org
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Daniel Gomez <da.gomez@samsung.com>
Cc: Pankaj Raghav <p.raghav@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/swapfile.c |    9 +++++++++
 1 file changed, 9 insertions(+)

--- a/mm/swapfile.c~swapfile-disable-swapon-for-bs-ps-devices
+++ a/mm/swapfile.c
@@ -3335,6 +3335,15 @@ SYSCALL_DEFINE2(swapon, const char __use
 	}
 
 	/*
+	 * The swap subsystem needs a major overhaul to support this.
+	 * It doesn't work yet so just disable it for now.
+	 */
+	if (mapping_min_folio_order(mapping) > 0) {
+		error = -EINVAL;
+		goto bad_swap_unlock_inode;
+	}
+
+	/*
 	 * Read the swap header.
 	 */
 	if (!mapping->a_ops->read_folio) {
_

Patches currently in -mm which might be from mcgrof@kernel.org are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-05-07  1:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-07  1:42 [merged] swapfile-disable-swapon-for-bs-ps-devices.patch removed from -mm tree Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.