Re: [nfsv4] xattr model in draft-naik-nfsv4-xattrs-01?

Manoj Naik <mnaik@us.ibm.com> Mon, 06 October 2014 21:00 UTC

Return-Path: <mnaik@us.ibm.com>
X-Original-To: nfsv4@ietfa.amsl.com
Delivered-To: nfsv4@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BEF1D1A032C for <nfsv4@ietfa.amsl.com>; Mon, 6 Oct 2014 14:00:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.086
X-Spam-Level:
X-Spam-Status: No, score=-7.086 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, J_CHICKENPOX_35=0.6, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.786, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MAnnelS2l0eq for <nfsv4@ietfa.amsl.com>; Mon, 6 Oct 2014 14:00:50 -0700 (PDT)
Received: from e8.ny.us.ibm.com (e8.ny.us.ibm.com [32.97.182.138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 109D81A02E4 for <nfsv4@ietf.org>; Mon, 6 Oct 2014 14:00:49 -0700 (PDT)
Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for <nfsv4@ietf.org> from <mnaik@us.ibm.com>; Mon, 6 Oct 2014 17:00:49 -0400
Received: from d01dlp03.pok.ibm.com (9.56.250.168) by e8.ny.us.ibm.com (192.168.1.108) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 6 Oct 2014 17:00:48 -0400
Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id E1F8FC90042 for <nfsv4@ietf.org>; Mon, 6 Oct 2014 16:49:31 -0400 (EDT)
Received: from d01av05.pok.ibm.com (d01av05.pok.ibm.com [9.56.224.195]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s96L0dKg6619544 for <nfsv4@ietf.org>; Mon, 6 Oct 2014 21:00:47 GMT
Received: from d01av05.pok.ibm.com (localhost [127.0.0.1]) by d01av05.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s96L0F4m000739 for <nfsv4@ietf.org>; Mon, 6 Oct 2014 17:00:15 -0400
Received: from d01ml605.pok.ibm.com (d01ml605.pok.ibm.com [9.63.8.148]) by d01av05.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s96L0Faj032408 for <nfsv4@ietf.org>; Mon, 6 Oct 2014 17:00:15 -0400
In-Reply-To: <20141005072228.GA6312@lst.de>
References: <20141004161750.GA22828@lst.de> <OF88F663C8.C237679D-ON88257D67.006E4B58-88257D67.0070FBCC@us.ibm.com> <20141005072228.GA6312@lst.de>
X-KeepSent: E40CB917:BC1F18C3-88257D69:0071923E; type=4; name=$KeepSent
To: Christoph Hellwig <hch@lst.de>
X-Mailer: IBM Notes Release 9.0.1FP2 August 03, 2014
Message-ID: <OFE40CB917.BC1F18C3-ON88257D69.0071923E-88257D69.007356B2@us.ibm.com>
From: Manoj Naik <mnaik@us.ibm.com>
Date: Mon, 06 Oct 2014 13:59:49 -0700
X-MIMETrack: Serialize by Router on D01ML605/01/M/IBM(Release 9.0.1FP1|April 03, 2014) at 10/06/2014 05:00:14 PM
MIME-Version: 1.0
Content-type: multipart/alternative; Boundary="0__=07BBF7FADFE214AE8f9e8a93df938690918c07BBF7FADFE214AE"
Content-Disposition: inline
X-TM-AS-MML: disable
X-Content-Scanned: Fidelis XPS MAILER
x-cbid: 14100621-0320-0000-0000-000000AF1B8C
Archived-At: http://mailarchive.ietf.org/arch/msg/nfsv4/Tj5Dl1knAdf7_X-Yn1UKvTYfaSA
Cc: nfsv4@ietf.org
Subject: Re: [nfsv4] xattr model in draft-naik-nfsv4-xattrs-01?
X-BeenThere: nfsv4@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: NFSv4 Working Group <nfsv4.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/nfsv4/>
List-Post: <mailto:nfsv4@ietf.org>
List-Help: <mailto:nfsv4-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 06 Oct 2014 21:00:56 -0000



Christoph Hellwig <hch@lst.de> wrote on 10/05/2014 12:22:28 AM:

> From: Christoph Hellwig <hch@lst.de>
> To: Manoj Naik/Almaden/IBM@IBMUS
> Cc: nfsv4@ietf.org
> Date: 10/05/2014 12:22 AM
> Subject: Re: xattr model in draft-naik-nfsv4-xattrs-01?
>
> On Sat, Oct 04, 2014 at 01:34:04PM -0700, Manoj Naik wrote:
> > The operations capture those requirements.
>
> While they happen to also implement those the focus seems to be on a lot
> of more complicated cruft, thus making the straight forward
> implementation of those requirements unessecarily complex.
>
> > > On the GETXATTR side you conflate the LISTXATTR operation with
GETXATTR,
> > > as well as adding a new bulk get one that isn't present in any OS API
> > > I know.  Both the argument and return structures are basically
entirely
> > > different for the different cases.
> >
> > Agree that GETXATTR includes what is traditionally provided by
listxattr()
> > call. The idea was to limit the number of new operations provided to
two -
> > GETXATTR and SETXATTR. But if there is consensus, we don't have an
issue
> > with adding a LISTXATTR instead.
>
>
> Why would you want to limit the number of operations?  Adding a new
> compound operation just is a new entry in a new dispatch table, which
> adding tons of unions complicates parsing at runtime, bloats data
> structures and makes the standard unreadable, thus placing a burden on
> human and machine.

I think you're referring to this:

        union getxattr_res4 switch (getxattr_type4 gr_type) {
         case GETXATTR4_LIST:
                xattrname4    gr_names<>;
         case GETXATTR4_ONE:
                xattrvalue4   gr_value;
         case GETXATTR4_ALL:
                xattr4        gr_xattrs<>;
        };

This isn't any more bloated/unreadable than a lot of existing protocol
definitions and operations. I am not arguing against LISTXATTR/REMOVEXATTR
being separate operations, but there is precedence in the existing spec for
operations that are far more complicated that this :)

>
> > I think the ability to get/set all xattrs of a given file
> > (getallxattrs/setallxattrs?) is useful, especially for backup/restore
> > programs. Granted that there isn't an OS API that exposes this, but
perhaps
> > there should be one? I know some backup utilities that work directly
with a
> > filesystem API to do this. Especially over NFS, I believe a single RPC
that
> > accomplishes this may be desirable.
>
> Setting multiple attributes can easily be archives by multiple SETXATTR
> operations in a compound.  Getting multiple attributes in one operation
> might sound useful, but there is a reason why it hasn't be implemented
> so far, and the main reason is that it's not sanely implementable at
> the OS lewvel.  More on that below.

An operation that replaces ALL the xattr keys of a file with another set of
keys could be done in a compound if we added a separate REMOVEXATTR that
allowed deleting all the xattrs of a file. Otherwise this would need a
LISTXATTR, delete individual xattrs and SETXATTR each one, and this cannot
be achieved in a single COMPOUND.

>
> > > Also how is the client supposed to cope with sizes of both each
> > > xattr and the list?  Don't we need a maxcount/mincount scheme similar
> > > to READDIR or GETDEVICEINFO?
> >
> > Explain? There is no limit imposed on the size of each xattr (as long
as it
> > is <= total size of all xattrs, i.e. maxxattrsize).
>
> Both setxattr and listxattr return data that basically is unbound for
> a simple request.  While this isn't a problem at the XDR level it is a
> problem at the syscall level.  If you look how the get and list
operations
> are specified you'll see that they take special care of this at the API
> level.

This is not unbounded for the protocol either. Section 4 states:

   Similar to ACLs, the amount of xattr data exchanged between the
   client and server for get/set operations can be considered to fit in
   a single COMPOUND request, bounded by the channel's negotiated
   maximum size for requests.

More on relaxing this requirement (for list/getall/setall) separately.

>
> All of them get passed a fixed sized pointer for the return buffer.  On
> IRIX the size paramter for the attr_get operation is an IN/OUT argument
> using a pointer, so when the size is not large enough it returns the
> expected size. This baiscally is a 1:1 mapping to the maxcount/mincount
> scheme in XDR.  Linux and FreeBSD aren't quite as smart and instead
> just return an error, but then expect the user to do a get or list
> call with a 0 size and NULL buffer to query the size of the attribute
> or attribute list.
>
> This also is a reason why the get all argument operation was never added
> to any OS - expressing this concept as a C API is incredibly complex
> with all those buffer sizing issue - you basically have to pass in the
> biggest possible buffers for the largest possible number of attributes,
> unless you want to do callee allocated buffers which isn't possible
> for syscall-level APIs.
>
> > Don't have a problem with this - we can add separate
LISTXATTR/REMOVEXATTR
> > if there is consensus. I'd still like to retain the ALL option though.
>
> Again they aren't in OS APIs for a good reason.  Besides an utterly
> horrible and crufty inferface they also are against the concept of the
> attr model where each attribute stands on it's own.  The concept of
> replacing or deleting all xattrs does not fit into any of the OS ABIs.
>
> I strongly disagree with NFS standards creating new unimplementable
> operations that further increase the deadwood in the specification.
>
> > > Instead of mentioning NTFS you should mention the API, preferably
with
> > > an informative reference.
> >
> > Probably - I can't find any informative references to this though.
> > Pointers?
>
> Ask the Microsoft representatives on the WG?  If it's not important
enough
> we might as well strike the reference, as an ondisk format isn't very
> relevant for NFS standardization.
>
> > I agree. Tom pointed out in his review of the first draft that it might
> > make sense to encapsulate some security attrs as xattrs if they could
be
> > generalized to be platform-independent. Hence I added this to Section
3:
> >
> >                                                Attributes from other
> >    namespaces are typically vendor-specific, but some of them may be
> >    generalized into well-defined set of names that promote
interoperable
> >    implementations.
> >
> > What wording can we add to enforce this? We've said the xattrs are
> > completely opaque (both in terms of key names and values), so adding a
> > namespace prefix in the key should be avoided. I like the idea of the
> > (Linux) client/server stripping off the "user." prefix, but can we do
> > better than adding strong verbiage that only attributes from the user
> > namespace can be specified?
>
> I don't think standardizing anything else is even remotely possible,
> all other attrs are higly OS-specific non-opaque data structures, so
> even leaving the options for them open is contrary to wording in much
> of the draft.
>
> > > Section 5.1:  a very useful attribute missing here is the maximum
size
> > > of each individual attribute.
> >
> > Why do we need this? I see file systems limit the total space taken by
> > xattrs, but not the maximum size of individual attributes. Of course,
we
> > can add it if needed.
>
> I don't known of a any (Linux) filesystem that has limits on the total
> size of all extended attributes.  There limits on the size of each
> attribute, further complicated by the fact that the extN limitations
> if for key+value combined, while the others I know only have individual
> limits for key and value.
>

OK, so we need an option to specify limit on individual xattr size. But
there are file systems that place limits on the total size as well.

Manoj.