From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 928121DF244; Tue, 29 Apr 2025 07:35:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745912136; cv=none; b=Pnjj5W2gBsT3nhH68zWQU9I7oJVRyPH4SRUx0XcKuxNYaOz8ztyZRFa17vfZrkYdwCR79pcElLP7GIhcveHIgB0KF0HGnkaqXOYQdmxSJwPMPwuBaWOQVdLEbK2dR4Htx5V0ea7AaIS4f0dr8UdDqFoWQIaTZp+ISzcfDLfkCYo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745912136; c=relaxed/simple; bh=h/pp2HdNTpjOUiFKbCs64eHDz4qBjP3GLukKUCSJBhQ=; h=Subject:To:Cc:From:Date:In-Reply-To:Message-ID:MIME-Version: Content-Type; b=jC5Ypd4HVYK/kgL2qUxhyXJ7zD506GTppxiRYi9H9VnAjHzQ+9wuzRoKHI46Q3fCZoZqOZubu98d7gt4TPr6fVkEm52Wh2Cutz2iIJZVoD3QzZww7gKcX+u68TgQRueKEZvGRHFqJgW32ZaQm7pHO/CFhiBYqluvSeitpheCcYs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DQYclAUq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="DQYclAUq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE22BC4CEE3; Tue, 29 Apr 2025 07:35:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1745912136; bh=h/pp2HdNTpjOUiFKbCs64eHDz4qBjP3GLukKUCSJBhQ=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=DQYclAUqb2epntKaeDQYKV/wGYZ1jRKV76mgK9h7TZZPy5Mt+OVRz1ArSzK/TGdT0 WpH37VAT6EzTVyGnst9Xv6FEZqv4REfp+AvADOCm7dXc2yY1iKcITJB8vTG5dWgn2C K2/7TfJKVDDaBi7J//0mqiSJ+4XZV7x/OAab/WEY= Subject: Patch "xfs: do not check NEEDSREPAIR if ro,norecovery mount." has been added to the 6.12-stable tree 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: From: Date: Tue, 29 Apr 2025 09:35:12 +0200 In-Reply-To: <174586545399.480536.11556523767440235148.stgit@frogsfrogsfrogs> Message-ID: <2025042912-refold-operative-f3ef@gregkh> Precedence: bulk X-Mailing-List: xfs-stable@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit X-stable: commit X-Patchwork-Hint: ignore 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 know about it. >From stable+bounces-136938-greg=kroah.com@vger.kernel.org Mon Apr 28 20:39:33 2025 From: "Darrick J. Wong" 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 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 Reviewed-by: Dave Chinner Reviewed-by: Eric Sandeen Signed-off-by: Carlos Maiolino Signed-off-by: Greg Kroah-Hartman --- 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