<font size="2"><span style="font-family: tahoma,sans-serif;"><br>Hi All,</span><br style="font-family: tahoma,sans-serif;"><br> I am trying to start a lxc container using libvirt and I am facing an issue due to pivot_root.<br style="font-family: tahoma,sans-serif;">
</font><font style="font-family: tahoma,sans-serif;" face="Tahoma, Verdana, Helvetica, Arial" size="2"><span>
<br>
The return code from the system call “pivot_root” is EINVAL (Invalid arguments).<br> I isolated the issue to this specific condition check within the system call.<br>
<br>
This is an code snippet from fs/namespace.c::pivot_root<br>
<br>
<i> error = -EINVAL;<br>
if (root.mnt->mnt_root != root.dentry)<br>
goto out2; /* not a mountpoint */<br>
<b> if (root.mnt->mnt_parent == root.mnt) <font color="#FF0000"><< this represents a circular mount reference <br>
</font> goto out2; /* not attached */ <br>
</b> if (new.mnt->mnt_root != new.dentry)<br>
goto out2; /* not a mountpoint */<br>
if (new.mnt->mnt_parent == new.mnt)<br>
goto out2; /* not attached */<br>
</i><br>
This issue occurs for me, since I am using fstype "rootfs" as "/" and all binaries are mounted ISO's for execution within "/".<br>Based on information from the below links, I have realized, that pivot_root is not possible for the above case.<b><br>
</b><font color="#0000FF"><u><a href="https://lkml.org/lkml/2005/10/8/17">https://lkml.org/lkml/2005/10/8/17</a><br>
<a href="https://bugzilla.kernel.org/show_bug.cgi?id=4857">https://bugzilla.kernel.org/show_bug.cgi?id=4857</a><br>
</u></font><br>I would like to know , if my observations are correct and is there any workaround to overcome this issue?<br><br>Any help in this regard would be useful.<br><br>-Alphonse<br>
</span></font>