Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7010635ybi; Thu, 13 Jun 2019 08:06:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqz36Hk3lKIAG08kjeW55sZbFG7vFj/EjcJCqoF29h+lx13p4+30YwgoTTNInretSMdpyhGv X-Received: by 2002:a63:ce08:: with SMTP id y8mr22037861pgf.38.1560438419326; Thu, 13 Jun 2019 08:06:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560438419; cv=none; d=google.com; s=arc-20160816; b=S4rsouAhY8jNHOTkLv+2hMhgDh0K2ks+d9CgXppHkoFYkyfBLnMD0yo5UB+6TQP1ag jz/Q8g70p0o+jtUQkfKcNl2JXhIYMFtULV9VzXBiES+Q6z0NEnpNpccnnYL0H+EpByXr eLWI+ckBpZzg2uDq8rIQUhBnYPMbK3U4kNE6GY8e0jGylJy3Y1W4i5Qp6nwHVlk2+vYi vMbzx55dKx4B+s6NbJwnrxrlRxLMR4UX4tMkkeft96LZxlDh6SSHYP4LjVCu/WZfDtWT dt75I7btgkTSvECSOL8xcH0Hf9eAYAh0kUmPxLeCMxXAEoIFXgJmaRNZ2OseFvIaMMkw dAMA== 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=ehkJYWC1p94ZapNpY1eAcwZHNv2DdSb1jRkL6CQmSXc=; b=jQJ8vdSZ4PMP/+oOECNCSfkVH90TmT8ZXnt1N8Zi6aDjAsOq+HimUEgmHe/2Wm23P1 7PlczH/h2B147qPl2auhDigUiesueDnGkcRyfNf2pVf6BbhiklRZYKUwzJ49LWr7VzRT BY6nroPY0EY6dBf59GMhXS/d2FwOeXnkH+LgSR8cjuSM6CKeOfPICV5Aexx7grpcahZB UdHVlZDcf/vuSzBCf5d4qswD8c5sSGdTgsTJADf6PKPDeP5Bz91zlYKopJ7cnJe3DH7M Ms4Pi1C/oblZ0Vsz7+w4etLNnT2DfvyTnI5KxkxsG6qwngoQj1DvJoIEKD6xRnWEPOb5 51eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=XzV9xpCh; 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 o4si46321pgi.160.2019.06.13.08.06.43; Thu, 13 Jun 2019 08:06:59 -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=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=XzV9xpCh; 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 S1732446AbfFMPFr (ORCPT + 99 others); Thu, 13 Jun 2019 11:05:47 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:42678 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732439AbfFMON2 (ORCPT ); Thu, 13 Jun 2019 10:13:28 -0400 Received: by mail-io1-f67.google.com with SMTP id u19so17180552ior.9 for ; Thu, 13 Jun 2019 07:13:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ehkJYWC1p94ZapNpY1eAcwZHNv2DdSb1jRkL6CQmSXc=; b=XzV9xpChVBAa9jqtcQ66PwrzgArnW79YoNikn4QKmOORtfYCNARNhku1YV8k8pRd0+ TpBceZrFLMj5ZWbnm89SpTimND8ZZ/i1NpGKPvDFFV7+kY5PhvA3deJRh1t1MviBz8d6 2WgvYrKsRmPboQ59Dsf3w67lwDKzEGbhgPQXM= 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=ehkJYWC1p94ZapNpY1eAcwZHNv2DdSb1jRkL6CQmSXc=; b=nSUlpIEfZpVslQMLG7hOu7x0lY9vDHQG7rZm7XyDJV+nmzPZrSFGfGo2v5Ua/9d/GW kp5dAI5cRzfZkFROJhy7govWrVSM9YslxtE6R6DboL5EDAJs3D4g3HVime5W3+LlJf8X 76C/fA0Rmsg+fMhp7jOctParrKpvONdJHAJhx1ADUPIQeOprLghf2yTOOVXKjMx0uMem a7ArxdpVxv+ADd/ligpk6gPF2KT5mVXx52RcFt1Y5b2ouTE5JAEkZwAw2Y65WjfLW4Ta DA+NY8uV9vyIcabzOHTpQymkVv6SnQJMcCiBn8jXwUDsyO+SEMeXx72QRHEdFQ2k4zCg +Jfw== X-Gm-Message-State: APjAAAWx2OTaIEYjJIzVj72C5gFQX3tu4RqoCxwY2av7fOmUR/QMQsYj HIic5KL99O8MSZEucb6fGGXtCLlAce9crI+y0qUMCw== X-Received: by 2002:a5e:8618:: with SMTP id z24mr54385645ioj.174.1560435207415; Thu, 13 Jun 2019 07:13:27 -0700 (PDT) MIME-Version: 1.0 References: <20190612172408.22671-1-amir73il@gmail.com> <20190612183156.GA27576@fieldses.org> In-Reply-To: <20190612183156.GA27576@fieldses.org> From: Miklos Szeredi Date: Thu, 13 Jun 2019 16:13:15 +0200 Message-ID: Subject: Re: [PATCH v2] locks: eliminate false positive conflicts for write lease To: "J . Bruce Fields" Cc: Amir Goldstein , Jeff Layton , linux-fsdevel@vger.kernel.org, Linux NFS list , overlayfs 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 Wed, Jun 12, 2019 at 8:31 PM J . Bruce Fields wrote: > > How do opens for execute work? I guess they create a struct file with > FMODE_EXEC and FMODE_RDONLY set and they decrement i_writecount. Do > they also increment i_readcount? Reading do_open_execat and alloc_file, > looks like it does, so, good, they should conflict with write leases, > which sounds right. Right, but then why this: > > + /* Eliminate deny writes from actual writers count */ > > + if (wcount < 0) > > + wcount = 0; It's basically a no-op, as you say. And it doesn't make any sense logically, since denying writes *should* deny write leases as well... Thanks, Miklos