Re: [PATCH 16/24] link_path_walk: kill the recursion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 20, 2015 at 11:13 AM, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
>   */
>  static int link_path_walk(const char *name, struct nameidata *nd)
>  {
> +       struct saved {
> +               struct path link;
> +               void *cookie;
> +               const char *name;
> +       } stack[MAX_NESTED_LINKS], *last = stack + nd->depth - 1;
>         struct path next;
>         int err;

I was going to complain about this, and suggest that you move it to
the nameidata, but I see that you did that later.

That said, you then introduce a stack-allocated "struct saved stack[]"
in path_mountpoint[] instead, *and* nameidata is saved on stack, so
this all ends up being very stack-intensive anyway.

I might have missed some patch here, but would it be possible to just
allocate a single per-thread nameidata, and just leave it at that?
Because allocating that thing on the stack when it contains what is
now one kilobyte of array data is *not* acceptable.

Other than that, my quick scan through this looked fine. And maybe
that quick scan missed where you already did that too.

                           Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux