From: Alexander Mikhalitsyn Date: Wed, 2 Apr 2025 08:52:16 +0000 (+0200) Subject: lxc/conf: handle rootfs open_at error in lxc_mount_rootfs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=becd5538e66a5437a661ca1c77580c8c1766b733;p=thirdparty%2Flxc.git lxc/conf: handle rootfs open_at error in lxc_mount_rootfs If LXC build is misconfigured, for instance, --prefix=/ and /lib is a symlink to /usr/lib then open_at always fails to open rootfs. Let's add error print to make it easier to figure out this. Signed-off-by: Alexander Mikhalitsyn --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 1410ebe54..f711d95b7 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1247,7 +1247,7 @@ static int lxc_mount_rootfs(struct lxc_rootfs *rootfs) rootfs->dfd_mnt = open_at(-EBADF, rootfs->mount, PROTECT_OPATH_DIRECTORY, PROTECT_LOOKUP_ABSOLUTE_XDEV, 0); if (rootfs->dfd_mnt < 0) - return -errno; + return log_error_errno(-1, errno, "Failed to open rootfs \"%s\"", rootfs->mount); return log_trace(0, "Container uses separate rootfs. Opened container's rootfs"); }