]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/mountpoint-util: for old kernels, assume "norecovery" is supported by btrfs
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 21 May 2024 08:39:39 +0000 (10:39 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 21 May 2024 13:13:42 +0000 (15:13 +0200)
Fixup for e3828d7103a99a15a1e947ba3063294ead590631, as requested in
https://github.com/systemd/systemd/pull/32892#issuecomment-2117903328.

src/basic/mountpoint-util.c

index 8e0dbb703a5a93664f63f350cf920bc5cfa3be43..66fa35b63090cb6c074c5dca826951d0f3e8c233 100644 (file)
@@ -511,8 +511,12 @@ const char* fstype_norecovery_option(const char *fstype) {
          * old name if the new name doesn't work. */
         if (streq(fstype, "btrfs")) {
                 r = mount_option_supported(fstype, "rescue=nologreplay", NULL);
+                if (r == -EAGAIN) {
+                        log_debug_errno(r, "Failed to check for btrfs 'rescue=nologreplay' option, assuming old kernel with 'norecovery': %m");
+                        return "norecovery";
+                }
                 if (r < 0)
-                        log_debug_errno(r, "Failed to check for btrfs rescue=nologreplay option, assuming it is not supported: %m");
+                        log_debug_errno(r, "Failed to check for btrfs 'rescue=nologreplay' option, assuming it is not supported: %m");
                 if (r > 0)
                         return "rescue=nologreplay";
         }