Skip to content

Commit a3c08da

Browse files
author
CKI KWF Bot
committed
Merge: Allow mounting XFS with ro,norecovery even if NEEDSREPAIR is set
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1145 JIRA: https://issues.redhat.com/browse/RHEL-101641 ``` commit 9e00163 Author: Lukas Herbolt <lukas@herbolt.com> Date: Mon Feb 3 09:55:13 2025 +0100 xfs: do not check NEEDSREPAIR if ro,norecovery mount. 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: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com> --- <small>Created 2025-07-02 17:10 UTC by backporter - [KWF FAQ](https://red.ht/kernel_workflow_doc) - [Slack #team-kernel-workflow](https://redhat-internal.slack.com/archives/C04LRUPMJQ5) - [Source](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/webhook/utils/backporter.py) - [Documentation](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/docs/README.backporter.md) - [Report an issue](https://issues.redhat.com/secure/CreateIssueDetails!init.jspa?pid=12334433&issuetype=1&priority=4&summary=backporter+webhook+issue&components=kernel-workflow+/+backporter)</small> Approved-by: Jarod Wilson <jarod@redhat.com> Approved-by: Brian Foster <bfoster@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents 9c91a4f + d16aa4d commit a3c08da

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fs/xfs/xfs_super.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,8 +1620,12 @@ xfs_fs_fill_super(
16201620
#endif
16211621
}
16221622

1623-
/* Filesystem claims it needs repair, so refuse the mount. */
1624-
if (xfs_has_needsrepair(mp)) {
1623+
/*
1624+
* Filesystem claims it needs repair, so refuse the mount unless
1625+
* norecovery is also specified, in which case the filesystem can
1626+
* be mounted with no risk of further damage.
1627+
*/
1628+
if (xfs_has_needsrepair(mp) && !xfs_has_norecovery(mp)) {
16251629
xfs_warn(mp, "Filesystem needs repair. Please run xfs_repair.");
16261630
error = -EFSCORRUPTED;
16271631
goto out_free_sb;

0 commit comments

Comments
 (0)