]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_scrub: don't error out if an optimize-only repair isn't supported
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 1 Aug 2018 22:06:44 +0000 (17:06 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 1 Aug 2018 22:06:44 +0000 (17:06 -0500)
If the kernel told us a metadata object could be optimized, we ask it to
do the optimization and it spits back that it doesn't support
optimizing, don't record this as an error since the fs is still
consistent.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
scrub/scrub.c

index 61caff9b0dc9a384945f397d30fdeee587d3388f..36f5a2d561b671e858b9e39a263997ab742c5fc4 100644 (file)
@@ -768,10 +768,11 @@ _("Filesystem is shut down, aborting."));
                case ENOTTY:
                case EOPNOTSUPP:
                        /*
-                        * If we forced repairs, don't complain if kernel
-                        * doesn't know how to fix.
+                        * If we forced repairs or this is a preen, don't
+                        * error out if the kernel doesn't know how to fix.
                         */
-                       if (debug_tweak_on("XFS_SCRUB_FORCE_REPAIR"))
+                       if (is_unoptimized(&oldm) ||
+                           debug_tweak_on("XFS_SCRUB_FORCE_REPAIR"))
                                return CHECK_DONE;
                        /* fall through */
                case EINVAL: