]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: abort mount if xfs_fs_reserve_ag_blocks fails
authorChristoph Hellwig <hch@lst.de>
Wed, 27 May 2026 12:32:37 +0000 (14:32 +0200)
committerCarlos Maiolino <cem@kernel.org>
Sat, 30 May 2026 06:26:18 +0000 (08:26 +0200)
xfs_mountfs currently ignores all errors from xfs_fs_reserve_ag_blocks,
which can lead to the mount path continuing on corruption errors.
Fix the check to only ignore -ENOSPC as in other callers, and unwind for
all other errors.

Fixes: 81ed94751b15 ("xfs: fix log intent recovery ENOSPC shutdowns when inactivating inodes")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_mount.c

index b24195f570cd8d8d0528b978cca0734f889fae1d..7aa51826b1ca5f479ea3798bd3a22a45b0b4ae9f 100644 (file)
@@ -1149,9 +1149,12 @@ xfs_mountfs(
         * blocks.
         */
        error = xfs_fs_reserve_ag_blocks(mp);
-       if (error && error == -ENOSPC)
+       if (error) {
+               if (error != -ENOSPC)
+                       goto out_rtunmount;
                xfs_warn(mp,
-       "ENOSPC reserving per-AG metadata pool, log recovery may fail.");
+"ENOSPC reserving per-AG metadata pool, log recovery may fail.");
+       }
        error = xfs_log_mount_finish(mp);
        xfs_fs_unreserve_ag_blocks(mp);
        if (error) {