teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

Blame 0189-fstab-generator-Do-not-try-to-fsck-non-devices.patch

Zbigniew Jędrzejewski-Szmek 126222
From 67ab7e43a7c5623af367193817f5b562d635b0aa Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek 126222
From: =?UTF-8?q?Thomas=20B=C3=A4chler?= <thomas@archlinux.org>
Zbigniew Jędrzejewski-Szmek 126222
Date: Sat, 21 Dec 2013 11:22:37 +0100
Zbigniew Jędrzejewski-Szmek 126222
Subject: [PATCH] fstab-generator: Do not try to fsck non-devices
Zbigniew Jędrzejewski-Szmek 126222
Zbigniew Jędrzejewski-Szmek 126222
This fixes a regression introduced in 64e70e4 where the mount fails
Zbigniew Jędrzejewski-Szmek 126222
when fstab is misconfigured with fs_passno > 0 on a virtual file
Zbigniew Jędrzejewski-Szmek 126222
system like nfs, and the type is specified as "auto".
Zbigniew Jędrzejewski-Szmek 126222
---
Zbigniew Jędrzejewski-Szmek 126222
 src/fstab-generator/fstab-generator.c | 5 +++++
Zbigniew Jędrzejewski-Szmek 126222
 1 file changed, 5 insertions(+)
Zbigniew Jędrzejewski-Szmek 126222
Zbigniew Jędrzejewski-Szmek 126222
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
Zbigniew Jędrzejewski-Szmek 126222
index 4137796..8c4c61c 100644
Zbigniew Jędrzejewski-Szmek 126222
--- a/src/fstab-generator/fstab-generator.c
Zbigniew Jędrzejewski-Szmek 126222
+++ b/src/fstab-generator/fstab-generator.c
Zbigniew Jędrzejewski-Szmek 126222
@@ -153,6 +153,11 @@ static int add_fsck(FILE *f, const char *what, const char *where, const char *ty
Zbigniew Jędrzejewski-Szmek 126222
         if (passno == 0)
Zbigniew Jędrzejewski-Szmek 126222
                 return 0;
Zbigniew Jędrzejewski-Szmek 126222
 
Zbigniew Jędrzejewski-Szmek 126222
+        if (!is_device_path(what)) {
Zbigniew Jędrzejewski-Szmek 126222
+                log_warning("Checking was requested for \"%s\", but it is not a device.", what);
Zbigniew Jędrzejewski-Szmek 126222
+                return 0;
Zbigniew Jędrzejewski-Szmek 126222
+        }
Zbigniew Jędrzejewski-Szmek 126222
+
Zbigniew Jędrzejewski-Szmek 126222
         if (type && !streq(type, "auto")) {
Zbigniew Jędrzejewski-Szmek 126222
                 int r;
Zbigniew Jędrzejewski-Szmek 126222
                 const char *checker;