<div dir="ltr">Hi,<div><br></div><div>I accidentally send new patches with the old subject. I was trying to add V2 or something to subject line but run git send-email mistakenly, you can use them but sorry about the confusion.</div>

<div><br></div><div style>Best,</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 23, 2013 at 5:19 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">Quoting Stéphane Graber (<a href="mailto:stgraber@ubuntu.com">stgraber@ubuntu.com</a>):<br>


> On 04/23/2013 05:29 AM, S.Çağlar Onur wrote:<br>
> > Hey Stéphane,<br>
> ><br>
> > On Wed, Apr 17, 2013 at 6:06 PM, Serge Hallyn <<a href="mailto:serge.hallyn@ubuntu.com">serge.hallyn@ubuntu.com</a><br>
> > <mailto:<a href="mailto:serge.hallyn@ubuntu.com">serge.hallyn@ubuntu.com</a>>> wrote:<br>
> ><br>
> >     Quoting S.Çağlar Onur (<a href="mailto:caglar@10ur.org">caglar@10ur.org</a> <mailto:<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> <mailto:<a href="mailto:caglar@10ur.org">caglar@10ur.org</a>>><br>
> >     ><br>
> >     > Trying to stop multiple containers concurrently ends up with<br>
> >     "cgroup is not mounted" errors as multiple threads corrupts the<br>
> >     shared variables.<br>
> >     > Fix that stack corruption and start to use getmntent_r to support<br>
> >     stopping multiple containers concurrently.<br>
> >     ><br>
> >     > Signed-off-by: S.Çağlar Onur <<a href="mailto:caglar@10ur.org">caglar@10ur.org</a><br>
> >     <mailto:<a href="mailto:caglar@10ur.org">caglar@10ur.org</a>>><br>
> >     > ---<br>
> >     >  src/lxc/cgroup.c  |  152<br>
> >     +++++++++++++++++++++++++++++++++++------------------<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<br>
> >     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<br>
> >     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>
> >     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?<br>
><br>
> So I had a quick look on an Android device. The stack size is the same<br>
> as a desktop machine (8192KB), so the 16KB used by that variable won't<br>
> be a problem.<br>
<br>
</div></div>thanks, Stéphane.  Then<br>
<br>
Acked-by: Serge E. Hallyn <<a href="mailto:serge.hallyn@ubuntu.com">serge.hallyn@ubuntu.com</a>><br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>S.Çağlar Onur <<a href="mailto:caglar@10ur.org">caglar@10ur.org</a>>
</div>