2
0
mirror of git://github.com/lxc/lxc synced 2025-08-31 12:09:35 +00:00

Skip rootfs pinning for read-only file system.

Signed-off-by: Wei Mingzhi <weimingzhi@baidu.com>
This commit is contained in:
Wei Mingzhi
2021-05-18 20:37:52 +08:00
parent 73936a0d5c
commit e859a5ee2c

View File

@@ -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);