All of lore.kernel.org
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: cem@kernel.org,dchinner@redhat.com,djwong@kernel.org,gregkh@linuxfoundation.org,lukas@herbolt.com,sandeen@redhat.com,xfs-stable@lists.linux.dev
Cc: <stable-commits@vger.kernel.org>
Subject: Patch "xfs: do not check NEEDSREPAIR if ro,norecovery mount." has been added to the 6.12-stable tree
Date: Tue, 29 Apr 2025 09:35:12 +0200	[thread overview]
Message-ID: <2025042912-refold-operative-f3ef@gregkh> (raw)
In-Reply-To: <174586545399.480536.11556523767440235148.stgit@frogsfrogsfrogs>


This is a note to let you know that I've just added the patch titled

    xfs: do not check NEEDSREPAIR if ro,norecovery mount.

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     xfs-do-not-check-needsrepair-if-ro-norecovery-mount.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From stable+bounces-136938-greg=kroah.com@vger.kernel.org Mon Apr 28 20:39:33 2025
From: "Darrick J. Wong" <djwong@kernel.org>
Date: Mon, 28 Apr 2025 11:39:19 -0700
Subject: xfs: do not check NEEDSREPAIR if ro,norecovery mount.
To: djwong@kernel.org, xfs-stable@lists.linux.dev
Cc: cem@kernel.org, dchinner@redhat.com, lukas@herbolt.com, sandeen@redhat.com, stable@vger.kernel.org
Message-ID: <174586545399.480536.11556523767440235148.stgit@frogsfrogsfrogs>

From: Lukas Herbolt <lukas@herbolt.com>

Commit 9e00163c31676c6b43d2334fdf5b406232f42dee upstream

If there is corrutpion on the filesystem andxfs_repair
fails to repair it. The last resort of getting the data
is to use norecovery,ro mount. But if the NEEDSREPAIR is
set the filesystem cannot be mounted. The flag must be
cleared out manually using xfs_db, to get access to what
left over of the corrupted fs.

Signed-off-by: Lukas Herbolt <lukas@herbolt.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/xfs/xfs_super.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)


--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1619,8 +1619,12 @@ xfs_fs_fill_super(
 #endif
 	}
 
-	/* Filesystem claims it needs repair, so refuse the mount. */
-	if (xfs_has_needsrepair(mp)) {
+	/*
+	 * Filesystem claims it needs repair, so refuse the mount unless
+	 * norecovery is also specified, in which case the filesystem can
+	 * be mounted with no risk of further damage.
+	 */
+	if (xfs_has_needsrepair(mp) && !xfs_has_norecovery(mp)) {
 		xfs_warn(mp, "Filesystem needs repair.  Please run xfs_repair.");
 		error = -EFSCORRUPTED;
 		goto out_free_sb;


Patches currently in stable-queue which might be from djwong@kernel.org are

queue-6.12/xfs-do-not-check-needsrepair-if-ro-norecovery-mount.patch
queue-6.12/xfs-do-not-allow-norecovery-mount-with-quotacheck.patch
queue-6.12/iomap-skip-unnecessary-ifs_block_is_uptodate-check.patch
queue-6.12/xfs-flush-inodegc-before-swapon.patch
queue-6.12/xfs-rename-xfs_iomap_swapfile_activate-to-xfs_vm_swap_activate.patch

  reply	other threads:[~2025-04-29  7:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-28 18:39 [PATCHSET 6.12] xfs: backported fixes from upstream Darrick J. Wong
2025-04-28 18:39 ` [PATCH 1/4] xfs: do not check NEEDSREPAIR if ro,norecovery mount Darrick J. Wong
2025-04-29  7:35   ` gregkh [this message]
2025-04-29 12:49   ` Sasha Levin
2025-04-28 18:39 ` [PATCH 2/4] xfs: Do not allow norecovery mount with quotacheck Darrick J. Wong
2025-04-29  7:35   ` Patch "xfs: Do not allow norecovery mount with quotacheck" has been added to the 6.12-stable tree gregkh
2025-04-29 12:50   ` [PATCH 2/4] xfs: Do not allow norecovery mount with quotacheck Sasha Levin
2025-04-28 18:39 ` [PATCH 3/4] xfs: rename xfs_iomap_swapfile_activate to xfs_vm_swap_activate Darrick J. Wong
2025-04-29  7:35   ` Patch "xfs: rename xfs_iomap_swapfile_activate to xfs_vm_swap_activate" has been added to the 6.12-stable tree gregkh
2025-04-29 12:50   ` [PATCH 3/4] xfs: rename xfs_iomap_swapfile_activate to xfs_vm_swap_activate Sasha Levin
2025-04-28 18:40 ` [PATCH 4/4] xfs: flush inodegc before swapon Darrick J. Wong
2025-04-29  7:35   ` Patch "xfs: flush inodegc before swapon" has been added to the 6.12-stable tree gregkh
2025-04-29 12:50   ` [PATCH 4/4] xfs: flush inodegc before swapon Sasha Levin

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=2025042912-refold-operative-f3ef@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=cem@kernel.org \
    --cc=dchinner@redhat.com \
    --cc=djwong@kernel.org \
    --cc=lukas@herbolt.com \
    --cc=sandeen@redhat.com \
    --cc=stable-commits@vger.kernel.org \
    --cc=xfs-stable@lists.linux.dev \
    /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.