Re: [nfsv4] one umask-02 question

Andreas Gruenbacher <agruenba@redhat.com> Fri, 02 December 2016 00:57 UTC

Return-Path: <agruenba@redhat.com>
X-Original-To: nfsv4@ietfa.amsl.com
Delivered-To: nfsv4@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0B5F2129A1D for <nfsv4@ietfa.amsl.com>; Thu, 1 Dec 2016 16:57:46 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.421
X-Spam-Level:
X-Spam-Status: No, score=-1.421 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=no autolearn_force=no
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 mhxBDoaX5of0 for <nfsv4@ietfa.amsl.com>; Thu, 1 Dec 2016 16:57:44 -0800 (PST)
Received: from mail-ua0-f178.google.com (mail-ua0-f178.google.com [209.85.217.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6F29B1293DF for <nfsv4@ietf.org>; Thu, 1 Dec 2016 16:57:44 -0800 (PST)
Received: by mail-ua0-f178.google.com with SMTP id 20so266557393uak.0 for <nfsv4@ietf.org>; Thu, 01 Dec 2016 16:57:44 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=62FtW+ZbHvVSMtjNy8vTLNq302DxwcWIJQB50Y934Hs=; b=mRe+ZeafY7qRAmgtcc5abF4OnZ0S24Aw1IBiNFOcx+hhv+AMaEvhbR4pTBY+BEvpyd guQJVeUOQkgTQhS8JCgdsyudevFj7gA7csIHU/izV1xkiKDqDlExxocg9sE4u+KGXhHf e+2olLfO46akAuC/bY356RfAhNIr4tCA/ZGMHME7dvGm+XXsjQYDnuKb3X72FnRm0js6 HcgqSq7M5tv27K7y2jeO450IkATfg0mCHZG3BSoxWIYYCk5EDdGNaPa0BKmZ0HgruJK/ Dkj6q+mdBrsHTq0gppPBc7KOR1Lv+u4GVToECer74z+qHTL/+1au+DjQOrmel6SoldeS Jnkg==
X-Gm-Message-State: AKaTC00xRZ6JYDTmpR9liSTI125+Q0PCsEXK+W+kNTb1O0d4WX8K3dsHICCqZasQtegkjGG4DJVnjzYPmirGe3tP
X-Received: by 10.176.68.132 with SMTP id n4mr26069924uan.75.1480640263470; Thu, 01 Dec 2016 16:57:43 -0800 (PST)
MIME-Version: 1.0
Received: by 10.176.81.33 with HTTP; Thu, 1 Dec 2016 16:57:43 -0800 (PST)
In-Reply-To: <20161201220137.GA1589@fieldses.org>
References: <3471.1480623047@athyra-vm1.us.oracle.com> <CADaq8jeHsqRi8PEJPVs0uma_9TjGrFVj=-yq-4NF-9awX6wP0g@mail.gmail.com> <20161201220137.GA1589@fieldses.org>
From: Andreas Gruenbacher <agruenba@redhat.com>
Date: Fri, 02 Dec 2016 01:57:43 +0100
Message-ID: <CAHc6FU6OkNWi1HP79auC10pqF03DJcm2kExNLhg9z-ofDRjmYA@mail.gmail.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/e5z88SkaMDQ4n8Mj25fZ1ncWWJo>
Cc: "nfsv4@ietf.org" <nfsv4@ietf.org>
Subject: Re: [nfsv4] one umask-02 question
X-BeenThere: nfsv4@ietf.org
X-Mailman-Version: 2.1.17
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: <https://mailarchive.ietf.org/arch/browse/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: Fri, 02 Dec 2016 00:57:46 -0000

On Thu, Dec 1, 2016 at 11:01 PM, J. Bruce Fields <bfields@fieldses.org> wrote:
> On Thu, Dec 01, 2016 at 04:49:18PM -0500, David Noveck wrote:
>> > I don't understand why the server doesn't return an error in
>> > this case.
>>
>> I'm not sure either.  Part of the problem may be that it isn't clear what
>> error to return.  INVAL is ised to inicate an unknown attribute or one used
>> with the wrong operation (get vs. set)
>
> It has other uses too; e.g. see rfc5661 6.2.5, which is very similar:
>
>         If the mode and mode_set_masked attributes are both specified in
>         the same SETATTR, the server MUST also return NFS4ERR_INVAL.
>
> I think INVAL would be fine.
>
>> so maybe we would need NFS4ERR_BADATTRCOMB.
>>
>> > Silently throwing stuff away makes me nervous.
>>
>> I can see how that statement would raise red flags.
>>
>> On the other hand, suppose there were no such statement and a create
>> contained both mode and umask.  Allowing these to be applied in whatever
>> order the server chooses is a recipe for non-interoperable
>> implementations.  The natural thing is to say that if both of these
>> attributes are present, umask is (MUST be) applied  last, in which case
>> mode would have no effect.  The effect is the same as saying it MUST be
>> ignored, but in this case, it is not a directive but a consequence of the
>> fact that anything it says will be overwritten as part of creating the file.
>
> I don't have any strong reason to care whether we require mode to be
> ignored (or, equivalently, applied first), or we require INVAL be
> returned.  Andreas, am I missing anything?

Ignoring the mode attribute when mode_umask is set should be the
easiest thing to implement; returning INVAL will always require
additional code that doesn't actually add any benefits. If it makes
anyone feel better, we might just as well require INVAL to be
returned, though.

Thanks,
Andreas