From 8be17c9b136c6884f38dde9e3ec519886ad4c7e0 Mon Sep 17 00:00:00 2001 From: Lauri Tirkkonen Date: Wed, 28 Mar 2018 13:57:21 +0300 Subject: [PATCH] nspawn: do not insist on locking read-only container on readonly fs (#8589) --- src/shared/machine-image.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c index 3a1d7de..faa2eb0 100644 --- a/src/shared/machine-image.c +++ b/src/shared/machine-image.c @@ -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) { -- 2.7.4