Re: [PATCH] NFS: allow name_to_handle_at() to work for Amazon EFS.

From: Linus Torvalds
Date: Wed Dec 06 2017 - 21:07:13 EST


On Thu, Nov 30, 2017 at 12:56 PM, NeilBrown <neilb@xxxxxxxx> wrote:
>
> -/* limit the handle size to NFSv4 handle size now */
> -#define MAX_HANDLE_SZ 128
> +/* Must be larger than NFSv4 file handle, but small
> + * enough for an on-stack allocation. overlayfs doesn't
> + * want this too close to 255.
> + */
> +#define MAX_HANDLE_SZ 200

This really smells for so many reasons.

Also, that really is starting to be a fairly big stack allocation, and
it seems to be used in exactly one place (show_mark_fhandle), which
makes me go "why is that on the stack anyway?".

Could we just allocate a buffer at open time or something?

Linus