<div dir="ltr">Hey Stéphane,<div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 17, 2013 at 6:06 PM, Serge Hallyn <span dir="ltr"><<a href="mailto:serge.hallyn@ubuntu.com" target="_blank">serge.hallyn@ubuntu.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">Quoting S.Çağlar Onur (<a href="mailto:caglar@10ur.org">caglar@10ur.org</a>):<br>


> From: "S.Çağlar Onur" <<a href="mailto:caglar@10ur.org">caglar@10ur.org</a>><br>
><br>
> Trying to stop multiple containers concurrently ends up with "cgroup is not mounted" errors as multiple threads corrupts the shared variables.<br>
> Fix that stack corruption and start to use getmntent_r to support stopping multiple containers concurrently.<br>
><br>
> Signed-off-by: S.Çağlar Onur <<a href="mailto:caglar@10ur.org">caglar@10ur.org</a>><br>
> ---<br>
>  src/lxc/cgroup.c  |  152 +++++++++++++++++++++++++++++++++++------------------<br>
>  src/lxc/freezer.c |   18 +++++--<br>
>  src/lxc/state.c   |   15 ++++--<br>
>  3 files changed, 126 insertions(+), 59 deletions(-)<br>
><br>
> diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c<br>
> index 368214f..0739477 100644<br>
> --- a/src/lxc/cgroup.c<br>
> +++ b/src/lxc/cgroup.c<br>
> @@ -54,6 +54,11 @@ lxc_log_define(lxc_cgroup, lxc);<br>
><br>
>  #define MTAB "/proc/mounts"<br>
><br>
> +/* In the case of a bind mount, there could be two long pathnames in the<br>
> + * mntent plus options so use large enough buffer size<br>
> + */<br>
> +#define LARGE_MAXPATHLEN 4 * MAXPATHLEN<br>
> +<br>
>  /* Check if a mount is a cgroup hierarchy for any subsystem.<br>
>   * Return the first subsystem found (or NULL if none).<br>
>   */<br>
> @@ -100,29 +105,31 @@ static char *mount_has_subsystem(const struct mntent *mntent)<br>
>   */<br>
>  static int get_cgroup_mount(const char *subsystem, char *mnt)<br>
>  {<br>
> -     struct mntent *mntent;<br>
> +     struct mntent *mntent, mntent_r;<br>
>       FILE *file = NULL;<br>
>       int ret, err = -1;<br>
><br>
> +     char buf[LARGE_MAXPATHLEN] = {0};<br>
<br>
</div></div>Ah yes, this must be what I thought we were waiting on - a response<br>
from Stéphane on this.<br>
<br>
I'm still worried about this stack usage, especially in something<br>
which is rather commonly called.  Stéphane, is this a non-issue<br>
for arm?</blockquote><div><br></div><div style>Have you had a chance to look at that? Should I keep them like this or start to allocate them via calloc?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<span class=""><font color="#888888"><br>
-serge<br>
</font></span></blockquote></div><br><br clear="all"><div style>Cheers,</div>-- <br>S.Çağlar Onur <<a href="mailto:caglar@10ur.org">caglar@10ur.org</a>>
</div></div>