Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1493784pxj; Wed, 19 May 2021 07:13:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEIICniRSvjZb74DEvhs0sEokla/Vd4b1BZrkxvSc0iTScIlOJ+mqxWg4uB6lNQc5olgvE X-Received: by 2002:a17:907:1c0f:: with SMTP id nc15mr13119973ejc.27.1621433607038; Wed, 19 May 2021 07:13:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621433607; cv=none; d=google.com; s=arc-20160816; b=YBJe/J1ocQMtAnfBZdAj+Yp4M2PwB1anMyhQIOmYv5igKwkUBU6pS4OCQt1LDtgc0a n3Wrem3g9otXMOLPUyEJZs8MH+pJS8IDlEyI0MNsdBZya9hLz/Qq9szsskhJFSFyr9y0 Fk8CJyH2WGIrZy6kDb2ZMMRkNq4h2XKh3dgUqqh7vDt+nngYj7ehXiXPODq1WbfQD4iD I1JkpDnxVeggmg54AttaxuDJnD6X+W3MFBUfJZB6u5OXYspXh0jpQ8QODM5R7utcc3GN aWX0vEoSIeTVoXgD67lRr8xH6SEZPWhqXfzAK5VJqjimQWh9R53KEW/sjFTrJ8IxWT3d zp+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=37Kn3wU7h4fxXGH3w1mRKHTrlpASYF2B7OB9XxPtwso=; b=uT1Lfet32ak3qMGsY9Ysjc2X1uViGt/QN4CkJVK5gDvGvMP93z9M11PCOFZuFON8lw 55vQpSUVH4CxXEmq1UbDee0Ib/GNi/5gnYyX+Xp3dyGfZUN6xaOXBekjvgwlr+t1oSrl TSS0kDqmRW+zFOwdvu0cyAdCDvI8GtV9Au2+llbUecDQ0flaMq5KZzJyRaJ0GwjmvuLo EF16UpM7GTCX0OdB6/GQfx6eX8t9x4e/BYtBnjBXn+HR4btoET1IBu6Nbj4k79WH2MPD lsvM7Jf5p6/K7mSnxCBzTm08T2uH8q4QuS6WfJ4gMmeeWjMq5+fqiR2uCXahwndiYqsx hLOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=tO9Tp7MP; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch13si13601891ejb.305.2021.05.19.07.12.52; Wed, 19 May 2021 07:13:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=tO9Tp7MP; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242076AbhERHft (ORCPT + 99 others); Tue, 18 May 2021 03:35:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240235AbhERHfs (ORCPT ); Tue, 18 May 2021 03:35:48 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2192DC061573 for ; Tue, 18 May 2021 00:34:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=37Kn3wU7h4fxXGH3w1mRKHTrlpASYF2B7OB9XxPtwso=; b=tO9Tp7MPLO9/8oYQ5RwlGhF/Sh MjznWhtCZuDsMcP+umfPgHgHMRuDSBs/qgMLXks4Fg3bieqTd3EU7BXIx+keEwGE9mDqq2e6Ezs1g RPXlNU6illE/co7HDmKYCo03vZMywnRSOhXuwT5O/mSRjd8QRyRYqfDZGAr+PHGUul6trG/qquH/s 2O4fb/04DgMyMhUdCaeoBCDXNQ2EPm7EN0wu5KfqriF75ZMetb+EB36O3w3QyExTZrQyfdv0QNTQM nm634qqv2PPTruudTHBUvSKdjnOfa4qBQC6JtqbOKw0H3rLrmKNNGfVC4hva0wk+1f5dZjHVptfgv lR1pxXpA==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1liuEX-00Dlgy-G5; Tue, 18 May 2021 07:33:46 +0000 Date: Tue, 18 May 2021 08:33:41 +0100 From: Christoph Hellwig To: "bfields@fieldses.org" Cc: Christoph Hellwig , Trond Myklebust , "nickhuang@synology.com" , "chuck.lever@oracle.com" , "robbieko@synology.com" , "bingjingc@synology.com" , "linux-nfs@vger.kernel.org" , viro@zeniv.linux.org.uk Subject: Re: [PATCH] nfsd: Prevent truncation of an unlinked inode from blocking access to its directory Message-ID: References: <20210514035829.5230-1-nickhuang@synology.com> <00195ec8bf1752306f549540eed74c3938c5e312.camel@hammerspace.com> <20210517185659.GA4216@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210517185659.GA4216@fieldses.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, May 17, 2021 at 02:56:59PM -0400, bfields@fieldses.org wrote: > On Sat, May 15, 2021 at 08:02:39AM +0100, Christoph Hellwig wrote: > > On Fri, May 14, 2021 at 03:46:57PM +0000, Trond Myklebust wrote: > > > Why leave the commit_metadata() call under the lock? If you're > > > concerned about latency, then it makes more sense to call fh_unlock() > > > before flushing those metadata updates to disk. > > > > Also I'm not sure why the extra inode reference is needed. What speaks > > against just moving the dput out of the locked section? > > I don't know. Do you know why do_unlinkat() is doing the same thing? No. Al, any idea why unlink does the final dput under i_rwsem?