Skip to content

Commit d16aa4d

Browse files
author
CKI Backport Bot
committed
xfs: do not check NEEDSREPAIR if ro,norecovery mount.
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>
1 parent 71832c7 commit d16aa4d

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)