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

Manoj Naik <mnaik@us.ibm.com> Sat, 04 October 2014 20:34 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 C2D751A0242 for <nfsv4@ietfa.amsl.com>; Sat, 4 Oct 2014 13:34:14 -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_84=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 YuM_hOgmZ4lv for <nfsv4@ietfa.amsl.com>; Sat, 4 Oct 2014 13:34:12 -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 EA9EE1A0137 for <nfsv4@ietf.org>; Sat, 4 Oct 2014 13:34:11 -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>; Sat, 4 Oct 2014 16:34:10 -0400
Received: from d01dlp01.pok.ibm.com (9.56.250.166) by e8.ny.us.ibm.com (192.168.1.108) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 4 Oct 2014 16:34:08 -0400
Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 3056738C8039 for <nfsv4@ietf.org>; Sat, 4 Oct 2014 16:34:08 -0400 (EDT)
Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s94KY8R93146016 for <nfsv4@ietf.org>; Sat, 4 Oct 2014 20:34:08 GMT
Received: from d01av02.pok.ibm.com (localhost [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s94KY7qB011366 for <nfsv4@ietf.org>; Sat, 4 Oct 2014 16:34:08 -0400
Received: from d01ml605.pok.ibm.com (d01ml605.pok.ibm.com [9.63.8.148]) by d01av02.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s94KY7Vf011363; Sat, 4 Oct 2014 16:34:07 -0400
In-Reply-To: <20141004161750.GA22828@lst.de>
References: <20141004161750.GA22828@lst.de>
X-KeepSent: 88F663C8:C237679D-88257D67:006E4B58; type=4; name=$KeepSent
To: Christoph Hellwig <hch@lst.de>
X-Mailer: IBM Notes Release 9.0.1FP2 August 03, 2014
Message-ID: <OF88F663C8.C237679D-ON88257D67.006E4B58-88257D67.0070FBCC@us.ibm.com>
From: Manoj Naik <mnaik@us.ibm.com>
Date: Sat, 04 Oct 2014 13:34:04 -0700
X-MIMETrack: Serialize by Router on D01ML605/01/M/IBM(Release 9.0.1FP1|April 03, 2014) at 10/04/2014 04:34:07 PM
MIME-Version: 1.0
Content-type: multipart/alternative; Boundary="0__=07BBF7F4DFFDCDC88f9e8a93df938690918c07BBF7F4DFFDCDC8"
Content-Disposition: inline
X-TM-AS-MML: disable
X-Content-Scanned: Fidelis XPS MAILER
x-cbid: 14100420-0320-0000-0000-000000AAE8EC
Archived-At: http://mailarchive.ietf.org/arch/msg/nfsv4/Rw6Rjfu-LszuCgCU8Zuz-WO5ctM
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: Sat, 04 Oct 2014 20:34:14 -0000



Christoph Hellwig <hch@lst.de> wrote on 10/04/2014 09:17:50 AM:

> From: Christoph Hellwig <hch@lst.de>
> To: Manoj Naik/Almaden/IBM@IBMUS, nfsv4@ietf.org
> Date: 10/04/2014 09:17 AM
> Subject: xattr model in draft-naik-nfsv4-xattrs-01?
>
> Hi Manoj,
>
> can you explain what xattr model your draft is based on?  It seems to
> have extremly complicated semantics that include a lot of semantics
> not present in Linux/IRIX/FreeBSD xattrs.

Why do you say they are complicated? Section 5.3 lists what we need:

   Applications need to perform the following operations on a given
   file's extended attributes [5]:

   o  Given a file, return a list of all of the file's assigned extended
      attribute keys.

   o  Given a file and a key, return the corresponding value.

   o  Given a file, a key, and a value, assign that value to the key.

   o  Given a file and a key, remove that extended attribute from the
      file.

The operations capture those requirements.

>
> 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.

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. I know somebody on the list or at the
IETF meeting asked for this specifically too.

>
> I think we would be much better of starting with:
>
> GETXATTR:
>
> struct GETXATTR4args {
>    /* CURRENT_FH: file */
>    xattrname4   ga_name;
> }
>
> struct GETXATTR4res {
>    xattrvalue4   gr_value;
> }
>
> LISTXATTR:
>
> struct LISTXATTR4args {
>    /* CURRENT_FH: file */
> }
>
> struct LISTXATTR4res {
>    xattrname4   gr_names<>
> };
>
> 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).

>
>
> In the SETXATTR I would suggest to remove the _ALL types, and the
> multiplexing not present in any OS API.  Additionally we need an
> anything goes type that can create or replace to properly support
> the existing Linux/IRIX/FreeBSD semantics.  The remove case could
> be roled into this - while none of the OS APIs do this, the Linux
> kernel internal API does and it works fairly well, although I still
> think a separate operation would be cleaner protocol wise:
>
> enum setxattr_type4 {
>    SETXATTR4_ANY      = 0,
>    SETXATTR4_CREATE   = 1,
>    SETXATTR4_REPLACE   = 2,
> }
>
> struct SETXATTR4args {
>    /* CURRENT_FH: file */
>    setxattr_type4   sa_type;
>    xattrname4   sa_xattrname;
> }
>
> struct SETXATTR4res {
>    nfsstat4 sr_res;
> }
>
> struct REMOVEXATTR4args {
>    /* CURRENT_FH: file */
>    xattrname4   sa_xattrname;
> }
>
> struct REMOVEXATTR4res {
>    nfsstat4 sr_res;
> }
>

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.

>
> A few more comments on the standard outside of this high level model:
>
> In Section 2. mentioning Solaris is wrong - Solaris never exposed
xattr-like
> APIs, just name attributes which are different and supported in NFSv4.

OK. See the referenced
http://docs.oracle.com/cd/E19253-01/816-5175/6mbba7f02/. Solaris still
calls them "extended file attributes", but you're right and I'll remove it.

>
> 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?

>
> Asking about not interpreting the name is a desaster waiting to happen
> given that Linux differs from the other implementations in how it handles
> the name.  I sent a separate mail about this earlier today, but I think
> trying to handle anything but the "user" xattrs in this protocol would
> be a grave mistake, so a Linux client would have to strip the "user."
> and a Linux server would have to add this "user."

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?

>
> 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.

Thanks for the comments.

Manoj.

>
>