]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
generator: also suppress fsck early if we are adding a bind mount
authorLennart Poettering <lennart@poettering.net>
Thu, 20 Mar 2025 09:33:56 +0000 (10:33 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 3 Apr 2025 08:22:46 +0000 (10:22 +0200)
There's no point in "fscking a bind mount". Let's not do it hence.

src/fstab-generator/fstab-generator.c
src/gpt-auto-generator/gpt-auto-generator.c
src/shared/generator.c
src/shared/generator.h

index 33c4c941f048d35b69f24e102bb694186e67c229..51df843f122967a638458ed2966804a730475c07 100644 (file)
@@ -605,7 +605,7 @@ static int add_mount(
                 fprintf(f, "After=%s\n", extra_after);
 
         if (passno != 0) {
-                r = generator_write_fsck_deps(f, dest, what, where, fstype);
+                r = generator_write_fsck_deps(f, dest, what, where, fstype, opts);
                 if (r < 0)
                         return r;
         }
index 54f674040be3168bdde139c90678b5b1e55e3837..167d15318f4ce6c94f60126bcd1e36082ff9a818 100644 (file)
@@ -245,7 +245,7 @@ static int add_mount(
         if (post)
                 fprintf(f, "Before=%s\n", post);
 
-        r = generator_write_fsck_deps(f, arg_dest, what, where, fstype);
+        r = generator_write_fsck_deps(f, arg_dest, what, where, fstype, opts_filtered);
         if (r < 0)
                 return r;
 
index 70fcd6e935d69c26bb50c0a92b0b4eefcd0b1adf..d4af0272b72f83872bfae177f9c070172557e643 100644 (file)
@@ -270,7 +270,8 @@ int generator_write_fsck_deps(
                 const char *dir,
                 const char *what,
                 const char *where,
-                const char *fstype) {
+                const char *fstype,
+                const char *options) {
 
         int r;
 
@@ -298,6 +299,11 @@ int generator_write_fsck_deps(
                 }
         }
 
+        if (fstab_test_option(options, "bind\0rbind\0")) {
+                log_debug("Skipping file system check for bind mount of '%s'.", what);
+                return 0;
+        }
+
         if (!is_device_path(what)) {
                 log_warning("Checking was requested for \"%s\", but it is not a device.", what);
                 return 0;
index 47cccd9c592047218bc52f6541123e6e17963dfa..fd342a280c7885c254aeb2c88e25dfb6d0b9619b 100644 (file)
@@ -22,7 +22,8 @@ int generator_write_fsck_deps(
         const char *dir,
         const char *what,
         const char *where,
-        const char *type);
+        const char *type,
+        const char *options);
 
 int generator_write_device_timeout(
         const char *dir,