Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3022235yba; Sun, 28 Apr 2019 15:09:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuSSF/KAdtnUJhXwRb3ZrcZih0ezhoHxYKjCbwXqvDOQ+mANKBxuR3Eof1fPb7PUfC8V3p X-Received: by 2002:a17:902:2f:: with SMTP id 44mr58658506pla.137.1556489373462; Sun, 28 Apr 2019 15:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556489373; cv=none; d=google.com; s=arc-20160816; b=NiJDDR7CBLZwtQ988UvYzS31PQU7Scq+dhxKe6hJjW28IzXQIADlywTE2i+VpO3B2e 9g9cjYwMOILOyTI8OcgU85iiLuc3YwbGuPHEW9x0m6rmVaEJ2bu5deiZaLohShQaXuOI 33DXF5BgpaqZqYW8L42ZMgokoqAotUGjVFRsoVf9+mp2etDL3ws0zmkRVB1tjPIoHBHz vy8r0g7kxxJ+1LeOnA+uk7QfYofmK5Yqrsvjfh3rd4JVnDs3brlEypLnXO+vkQsgayDX 5+8glRwaNfPyL9wBVi8XOxOZtOyUDPw6mg+S93N7CdgwLxqMjqPboLlRxY89fHH+OVca eQTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=UowcWs8y0NGAO7QnT930/knM1MIEOfa1b7WqTNQHJco=; b=eeBreKSjoenlY5qyW3M3+1FpgZPCG+AoQ46KR3EYU0RH8VQt8K5WtkSBN004m3Tvrw XWZLrlvfWeCcshAmZagaz7BcUSfelrF5hZLXnDW+KjIH0X6lylSNbqLLnqCH/vLdbFO2 tq1DbsW4guArxFEpp5LqO0l24pSQZaLEa9CpN4OKl/lhAveNHQa5hisF4JsG1mGQ/Ugb ZYCktRI41mLXOzEP8HJAHwdcGZVRQPwnX33n8FzN3dSAzxp3+U9snzuPEuYxWlR2Ieje a0KpJ5HJc/QvmV66YMXml8bPnV62h6IYp1gldGzofEQNWo8Od9zxdM+9RKPx1WKWKmuX /Q5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WUn9R0mz; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si29926032pga.498.2019.04.28.15.08.56; Sun, 28 Apr 2019 15:09:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WUn9R0mz; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726478AbfD1WAq (ORCPT + 99 others); Sun, 28 Apr 2019 18:00:46 -0400 Received: from mail-yw1-f47.google.com ([209.85.161.47]:42370 "EHLO mail-yw1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726435AbfD1WAp (ORCPT ); Sun, 28 Apr 2019 18:00:45 -0400 Received: by mail-yw1-f47.google.com with SMTP id y131so3053856ywa.9; Sun, 28 Apr 2019 15:00:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UowcWs8y0NGAO7QnT930/knM1MIEOfa1b7WqTNQHJco=; b=WUn9R0mzrF8SlWRavwbBrTw9rACo0epTaN8VpSiq10DdpdfcuH3qcWW1QKXaWWgh4P iDLBOlhPFHz+WkgAZ4eAR8OgotEOXRwBTG3QUSvHFz/c7etoJVTTIvv8haRg7CGX0Nd7 xO0Q5FIulDdq7aFGs+o/PCRqO/037GhmOaIFLbnBZVVP/SA46jCOTYBaFnmCA6xQqJef x7ouR5i+40BHjEPipkZ/g+ZQCjSCmo9sZxRyl1caADHq/ia3qDQDIT7KcRjSzeWONmav m88V/eCmCUVUJ8Uv6TbkjfsnLKFPW6o50WimbloVPsHXVmE9jG8CNy64bacKfO+in7tv P1lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UowcWs8y0NGAO7QnT930/knM1MIEOfa1b7WqTNQHJco=; b=deC0i3z9NgGkqAhgHH7ANcy0qffuOkYf9Xnzmyc8CAo/aZ3IKBB9mD7bNYatXVcfc4 ElMqvNsFoPXU9U+5mLo41Baw5GuJwVeDAN07Ikdxq641yw9xkJ9TIyF5ph/TgiIxbhxF LODXq+XswfeI6+BK4bdGsgxeFuIWpX9H6A9WxuFiL0U6AjTk27ufK2rdFc+2c7QzS2wJ J+d+s6WjLDGQUiJ3T0IMaPGNuaEe8Aqj66yF/Fj8qNv9YskdnG8JLfosCSNS6/Z81LYo pYN5o0tDMDdrM8qztqliP5hRgg4lqLGiddAPRTGzRBM+XC1qRjQ6S7Yg+rIp7qEzKxHi WFzA== X-Gm-Message-State: APjAAAXZfC9huTwhr5p1mYP5kCVqCSvB6RUI+vjRN3vQ3XjNoHGsqO4L ORqLNdGToHxwBy7oeLNrOi0VSXm2RgPWjcfddR+ptLLh X-Received: by 2002:a0d:ff82:: with SMTP id p124mr50257703ywf.409.1556488844487; Sun, 28 Apr 2019 15:00:44 -0700 (PDT) MIME-Version: 1.0 References: <379106947f859bdf5db4c6f9c4ab8c44f7423c08.camel@kernel.org> <930108f76b89c93b2f1847003d9e060f09ba1a17.camel@kernel.org> <20190426140023.GB25827@fieldses.org> <20190426145006.GD25827@fieldses.org> <8504a05f2b0462986b3a323aec83a5b97aae0a03.camel@kernel.org> <1d5265510116ece75d6eb7af6314e6709e551c6e.camel@hammerspace.com> In-Reply-To: <1d5265510116ece75d6eb7af6314e6709e551c6e.camel@hammerspace.com> From: Amir Goldstein Date: Sun, 28 Apr 2019 18:00:32 -0400 Message-ID: Subject: Re: Better interop for NFS/SMB file share mode/reservation To: Trond Myklebust Cc: "jlayton@kernel.org" , "bfields@fieldses.org" , "samba-technical@lists.samba.org" , "linux-nfs@vger.kernel.org" , "Volker.Lendecke@sernet.de" , "linux-fsdevel@vger.kernel.org" , "pshilov@microsoft.com" Content-Type: text/plain; charset="UTF-8" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Sun, Apr 28, 2019 at 11:06 AM Trond Myklebust wrote: > > On Sun, 2019-04-28 at 09:45 -0400, Amir Goldstein wrote: > > On Sun, Apr 28, 2019 at 8:09 AM Jeff Layton > > wrote: > > > On Sat, 2019-04-27 at 16:16 -0400, Amir Goldstein wrote: > > > > [adding back samba/nfs and fsdevel] > > > > > > > > > > cc'ing Pavel too -- he did a bunch of work in this area a few years > > > ago. > > > > > > > On Fri, Apr 26, 2019 at 6:22 PM Jeff Layton > > > > wrote: > > > > > On Fri, 2019-04-26 at 10:50 -0400, J. Bruce Fields wrote: > > > > > > On Fri, Apr 26, 2019 at 04:11:00PM +0200, Amir Goldstein > > > > > > wrote: > > > > > > > On Fri, Apr 26, 2019, 4:00 PM J. Bruce Fields < > > > > > > > bfields@fieldses.org> wrote: > > > > > > > > > > > > That said, we could also look at a vfs-level mount option that > > > > > would > > > > > make the kernel enforce these for any opener. That could also > > > > > be useful, > > > > > and shouldn't be too hard to implement. Maybe even make it a > > > > > vfsmount- > > > > > level option (like -o ro is). > > > > > > > > > > > > > Yeh, I am humbly going to leave this struggle to someone else. > > > > Not important enough IMO and completely independent effort to the > > > > advisory atomic open&lock API. > > > > > > Having the kernel allow setting deny modes on any open call is a > > > non- > > > starter, for the reasons Bruce outlined earlier. This _must_ be > > > restricted in some fashion or we'll be opening up a ginormous DoS > > > mechanism. > > > > > > My proposal was to make this only be enforced by applications that > > > explicitly opt-in by setting O_SH*/O_EX* flags. It wouldn't be too > > > difficult to also allow them to be enforced on a per-fs basis via > > > mount > > > option or something. Maybe we could expand the meaning of '-o mand' > > > ? > > > > > > How would you propose that we restrict this? > > > > > > > Our communication channel is broken. > > I did not intend to propose any implicit locking. > > If samba and nfsd can opt-in with O_SHARE flags, I do not > > understand why a mount option is helpful for the cause of > > samba/nfsd interop. > > > > If someone else is interested in samba/local interop than > > yes, a mount option like suggested by Pavel could be a good option, > > but it is an orthogonal effort IMO. > > If an NFS client 'opts in' to set share deny, then that still makes it > a non-optional lock for the other NFS clients, because all ordinary > open() calls will be gated by the server whether or not their > application specifies the O_SHARE flag. There is no flag in the NFS > protocol that could tell the server to ignore deny modes. > > IOW: it would suffice for 1 client to use O_SHARE|O_DENY* to opt all > the other clients in. > Sorry for being thick, I don't understand if we are in agreement or not. My understanding is that the network file server implementations (i.e. samba, knfds, Ganesha) will always use share/deny modes. So for example nfs v3 opens will always use O_DENY_NONE in order to have correct interop with samba and nfs v4. If I am misunderstanding something, please enlighten me. If there is a reason why mount option is needed for the sole purpose of interop between network filesystem servers, please enlighten me. Thanks, Amir.