Return-Path: Received: from mail-it0-f41.google.com ([209.85.214.41]:42161 "EHLO mail-it0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751950AbdLGCHD (ORCPT ); Wed, 6 Dec 2017 21:07:03 -0500 MIME-Version: 1.0 In-Reply-To: <87po7zv62h.fsf@notabene.neil.brown.name> References: <87po7zv62h.fsf@notabene.neil.brown.name> From: Linus Torvalds Date: Wed, 6 Dec 2017 18:07:01 -0800 Message-ID: Subject: Re: [PATCH] NFS: allow name_to_handle_at() to work for Amazon EFS. To: NeilBrown Cc: Trond Myklebust , Anna Schumaker , Al Viro , Andrew Morton , lkml , "linux-nfs@vger.kernel.org" , linux-fsdevel , Lennart Poettering Content-Type: text/plain; charset="UTF-8" Sender: linux-nfs-owner@vger.kernel.org List-ID: On Thu, Nov 30, 2017 at 12:56 PM, NeilBrown 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