[lxc-devel] lxc 0.7.4 does not mount anything
Michael Tokarev
mjt at tls.msk.ru
Fri Mar 11 21:23:17 UTC 2011
Daniel, this is this part:
conf.c:mount_entry_on_absolute_rootfs():
aux = strstr(mntent->mnt_dir, rootfs->path);
snprintf(path, MAXPATHLEN, "%s%s", rootfs->mount,
aux + strlen(rootfs->path));
if rootfs->path ends with a slash we happily eat it,
producing this in strace (I quoted it in my email):
[pid 2677] read(8, "none /lxc/c0/proc proc defaults "..., 4096) = 36
[pid 2677] mount("none", "/opt/lxc//lib/lxc/rootfsproc", "proc", 0, NULL) = 0
note "rootfsproc".
Don't use strstr there - it's not strstr, it's strSTART.
Also, it may be a good idea to also compare the beginning
of this string with rootfs->mount - this is where 0.7.3
mounted stuff so users of it may have changed their mounts
already and we break them again.
I spotted this yesterday when someone asked for help in
IRC but had no time to prepare a patch.
And we really, REALLY need to set default log level to
be at least warning instead of error, or else these
useful warnings goes nowhere.
/mjt
More information about the lxc-devel
mailing list