From: Wei Mingzhi Date: Tue, 18 May 2021 12:37:52 +0000 (+0800) Subject: Skip rootfs pinning for read-only file system. X-Git-Tag: lxc-5.0.0~168^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3844%2Fhead;p=thirdparty%2Flxc.git Skip rootfs pinning for read-only file system. Signed-off-by: Wei Mingzhi --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 7a248c268..4b427c08d 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -573,8 +573,12 @@ int lxc_rootfs_init(struct lxc_conf *conf, bool userns) PROTECT_OPEN | O_CREAT, PROTECT_LOOKUP_BENEATH, S_IWUSR | S_IRUSR); - if (fd_pin < 0) + if (fd_pin < 0) { + if (errno == EROFS) { + return log_trace_errno(0, EROFS, "Not pinning on read-only filesystem"); + } return syserror("Failed to pin rootfs"); + } TRACE("Pinned rootfs %d(.lxc_keep)", fd_pin);