]> git.proxmox.com Git - mirror_lxc.git/blobdiff - src/lxc/conf.c
Merge pull request #3843 from brauner/2021-05-17.idmapped.lxc.mount.entry
[mirror_lxc.git] / src / lxc / conf.c
index 953626e2753855603ca7e1dd9c7b474fd0b86286..30d5a86d3fa9d7f2717aca8378b1583bd04059ee 100644 (file)
@@ -580,8 +580,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);