All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,p.raghav@samsung.com,dave@stgolabs.net,da.gomez@samsung.com,brauner@kernel.org,mcgrof@kernel.org,akpm@linux-foundation.org
Subject: + swapfile-disable-swapon-for-bs-ps-devices.patch added to mm-unstable branch
Date: Mon, 05 May 2025 17:39:43 -0700	[thread overview]
Message-ID: <20250506003944.053EEC4CEF1@smtp.kernel.org> (raw)


The patch titled
     Subject: swapfile: disable swapon for bs > ps devices
has been added to the -mm mm-unstable branch.  Its filename is
     swapfile-disable-swapon-for-bs-ps-devices.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/swapfile-disable-swapon-for-bs-ps-devices.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
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

swapfile-disable-swapon-for-bs-ps-devices.patch


                 reply	other threads:[~2025-05-06  0:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250506003944.053EEC4CEF1@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=da.gomez@samsung.com \
    --cc=dave@stgolabs.net \
    --cc=mcgrof@kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=p.raghav@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.