nspawn: do not insist on locking read-only container on readonly fs (#8589)
authorLauri Tirkkonen <lotheac@iki.fi>
Wed, 28 Mar 2018 10:57:21 +0000 (13:57 +0300)
committerLennart Poettering <lennart@poettering.net>
Wed, 28 Mar 2018 10:57:21 +0000 (12:57 +0200)
src/shared/machine-image.c

index 3a1d7de..faa2eb0 100644 (file)
@@ -877,8 +877,13 @@ int image_path_lock(const char *path, int operation, LockFile *global, LockFile
          * block devices are device local anyway. */
         if (!path_startswith(path, "/dev")) {
                 r = make_lock_file_for(path, operation, &t);
-                if (r < 0)
-                        return r;
+                if (r < 0) {
+                        if ((operation & LOCK_SH) && r == -EROFS)
+                                log_debug_errno(r, "Failed to create shared "
+                                    "lock for %s: %m", path);
+                        else
+                                return r;
+                }
         }
 
         if (p) {