All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-virtualization][master][PATCH] lxc: Skip rootfs pinning for read-only filesystem
@ 2021-09-15 10:46 sana kazi
  0 siblings, 0 replies; only message in thread
From: sana kazi @ 2021-09-15 10:46 UTC (permalink / raw)
  To: meta-virtualization; +Cc: Sana Kazi

Added patch to skip rootfs pinning for read-only filesystem
which fixes below issue:

lxc-start[1559]: Error: oap: conf - conf.c:lxc_rootfs_init:581
- Read-only file system - Failed to pin rootfs
lxc-start[1744]: Error: node1: conf - conf.c:lxc_rootfs_init:581
- Read-only file system - Failed to pin rootfs
lxc-start[1745]: Error: ivi: conf - conf.c:lxc_rootfs_init:581
- Read-only file system - Failed to pin rootfs

Signed-off-by: Sana Kazi <Sana.Kazi@kpit.com>
Signed-off-by: Sana Kazi <sanakazisk19@gmail.com>
---
 ...tfs_pinning_for_read_only_filesystem.patch | 30 +++++++++++++++++++
 recipes-containers/lxc/lxc_4.0.9.bb           |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 recipes-containers/lxc/files/skip_rootfs_pinning_for_read_only_filesystem.patch

diff --git a/recipes-containers/lxc/files/skip_rootfs_pinning_for_read_only_filesystem.patch b/recipes-containers/lxc/files/skip_rootfs_pinning_for_read_only_filesystem.patch
new file mode 100644
index 0000000..c29d996
--- /dev/null
+++ b/recipes-containers/lxc/files/skip_rootfs_pinning_for_read_only_filesystem.patch
@@ -0,0 +1,30 @@
+From e859a5ee2cdee5111185a6a629f891aa40b2ffd6 Mon Sep 17 00:00:00 2001
+From: Wei Mingzhi <weimingzhi@baidu.com>
+Date: Tue, 18 May 2021 20:37:52 +0800
+Subject: [PATCH] Skip rootfs pinning for read-only file system.
+
+Signed-off-by: Wei Mingzhi <weimingzhi@baidu.com>
+---
+ src/lxc/conf.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+Upstream-Status: Backport [https://github.com/lxc/lxc/commit/966dad2494dda4948f1508bcd0e444f1d65b2df8.patch]
+Comment: No change in any hunk
+
+diff --git a/src/lxc/conf.c b/src/lxc/conf.c
+index 7a248c2685..4b427c08d2 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);
diff --git a/recipes-containers/lxc/lxc_4.0.9.bb b/recipes-containers/lxc/lxc_4.0.9.bb
index 6720733..ad2416f 100644
--- a/recipes-containers/lxc/lxc_4.0.9.bb
+++ b/recipes-containers/lxc/lxc_4.0.9.bb
@@ -50,6 +50,7 @@ SRC_URI = "http://linuxcontainers.org/downloads/${BPN}/${BPN}-${PV}.tar.gz \
 	file://dnsmasq.conf \
 	file://lxc-net \
         file://enable_seccomp_profile_when_compiled_libseccomp.patch \
+        file://skip_rootfs_pinning_for_read_only_filesystem.patch \
 	"
 
 SRC_URI[md5sum] = "365fcca985038910e19a1e0fff15ed07"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-15 10:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15 10:46 [meta-virtualization][master][PATCH] lxc: Skip rootfs pinning for read-only filesystem sana kazi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.