1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

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>
This commit is contained in:
Lukas Herbolt 2025-02-03 09:55:13 +01:00 committed by Carlos Maiolino
parent 6e33017c32
commit 9e00163c31

View file

@ -1661,8 +1661,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;