Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7011174ybi; Thu, 13 Jun 2019 08:07:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLcS9hOccwole0bki+OzvWxhDgwcW/WoCHpNm7q7Te6AVjRGLW3S+IvbN4GoKH++SXOSCh X-Received: by 2002:a63:2b92:: with SMTP id r140mr31558155pgr.363.1560438446751; Thu, 13 Jun 2019 08:07:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560438446; cv=none; d=google.com; s=arc-20160816; b=G1QbWJqyjJTNhmZLEQYuRsgDwP13xaIH07xWOSH3KIS5lYnwEVmG+8lCMjh4VsYxrt tiYjLsOK4uxOWPKq7riTffUX7z8zWuxkfe655fnsyANvACLnjeClQytr3DGEhbnTDHZQ spiswrEFXVxXkd4yX1wBteqw5MboYKh/TQWuj8AHOJsQNeUxxW7dsAV6HTpCQCWkYGxd H4wbrc3CAfkd77GmDXtFIwSX/+ryxQTjVAOf32IvJjygshyrm3QWZlMpy1aVMyREx2GM v+/Lm6ksQtZxKJEFkg2pRMbWwllHx+Fc+nbXrkpv2MzdLWUnyosjLzt7cmeqXkCNtFaz sXJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=06sSD3SSATGGAJb5V3LfIw7dKTYE8IQzVUU0cgVwoBc=; b=EH8tYImuWTsis5t7EkRSNDOIcxcw2hP5dci76eRQWXPl3T8NjtKguj7kQ7hkjmZABq yVFthymgdErHUIEgwcUuq5upxlpCUv23qEqKdbbWfKDmsxlClEHPKPbQQrZ6bdv0Lf9b tvUrdyJnjZS69Pe5yABpRZGIwkgoGsJ2df+9nyQaNoYcoJht0219qoc6gOLHySlAjHoQ NcqdMezojZI7YHNRFnWYACljAgUUML/OYgFYxCMUAEVqrVJsBli6WlK9LeWXj5fCB/d6 ypsqeoqGwFOeaRqgen9OBEunSUbsJLp/8or5bD6AohXxkEZVfWqQnPyMx4cJ3/JM+OoY DYNQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t16si3621515pfh.100.2019.06.13.08.07.11; Thu, 13 Jun 2019 08:07:26 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732984AbfFMPGl (ORCPT + 99 others); Thu, 13 Jun 2019 11:06:41 -0400 Received: from fieldses.org ([173.255.197.46]:52370 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732409AbfFMOIF (ORCPT ); Thu, 13 Jun 2019 10:08:05 -0400 Received: by fieldses.org (Postfix, from userid 2815) id 221021D27; Thu, 13 Jun 2019 10:08:04 -0400 (EDT) Date: Thu, 13 Jun 2019 10:08:04 -0400 From: "J . Bruce Fields" To: Amir Goldstein Cc: Jeff Layton , Miklos Szeredi , linux-fsdevel , Linux NFS Mailing List , overlayfs Subject: Re: [PATCH v2] locks: eliminate false positive conflicts for write lease Message-ID: <20190613140804.GA2145@fieldses.org> References: <20190612172408.22671-1-amir73il@gmail.com> <2851a6b983ed8b5b858b3b336e70296204349762.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, Jun 13, 2019 at 04:28:49PM +0300, Amir Goldstein wrote: > On Thu, Jun 13, 2019 at 4:22 PM Jeff Layton wrote: > > Looks good to me. Aside from the minor nit above: > > > > Reviewed-by: Jeff Layton > > > > I have one file locking patch queued up for v5.3 so far, but nothing for > > v5.2. Miklos or Bruce, if either of you have anything to send to Linus > > for v5.2 would you mind taking this one too? > > > > Well. I did send a fix patch to Miklos for a bug introduced in v5.2-rc4, > so... I could take it. I've modified it as below. I'm very happy with the patch, but not so much with the idea of 5.2 and stable. It seems like a subtle change with some possibility of unintended side effects. (E.g. I don't think this is true any more, but my memory is that for a long time the only thing stopping nfsd from giving out (probably broken) write delegations was an extra reference that it held during processing.) And if the overlayfs bug's been there since 4.19, then waiting a little longer seems OK? --b. diff --git a/fs/locks.c b/fs/locks.c index c7912b0fdeea..2056595751e8 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -1779,7 +1779,7 @@ check_conflicting_open(struct file *filp, const long arg, int flags) /* Make sure that only read/write count is from lease requestor */ if (filp->f_mode & FMODE_WRITE) self_wcount = 1; - else if ((filp->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) + else if (filp->f_mode & FMODE_READ) self_rcount = 1; if (arg == F_WRLCK && (wcount != self_wcount ||