fstab-generator: ignore x-systemd.device-timeout for non-devices (#6368)
authorNeilBrown <neil@brown.name>
Mon, 17 Jul 2017 08:03:34 +0000 (18:03 +1000)
committerLennart Poettering <lennart@poettering.net>
Mon, 17 Jul 2017 08:03:34 +0000 (10:03 +0200)
If you specify "x-systemd.device-timeout" for an NFS mount
point, you get no warning and a meaningless device unit
dependency created.

Better to have a warning and no dependency.

src/shared/generator.c

index 2f459bf..86e9356 100644 (file)
@@ -198,6 +198,10 @@ int generator_write_timeouts(
         node = fstab_node_to_udev_node(what);
         if (!node)
                 return log_oom();
+        if (!is_device_path(node)) {
+                log_warning("x-systemd.device-timeout ignored for %s", what);
+                return 0;
+        }
 
         r = unit_name_from_path(node, ".device", &unit);
         if (r < 0)