Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1020306rwe; Fri, 26 Aug 2022 21:40:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ZXkRWePyyjkkk0YGZeP29mua9yezLDH54MjeZwk5xk+OuWUk5qDqVW72iCJX98wPA5yJs X-Received: by 2002:a17:907:d8d:b0:741:4d1a:5954 with SMTP id go13-20020a1709070d8d00b007414d1a5954mr301432ejc.307.1661575222832; Fri, 26 Aug 2022 21:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661575222; cv=none; d=google.com; s=arc-20160816; b=vOCFSQv57BQw334JQjaaRipbYP6hxCYZDJjgY/8korwd2C8h3npEYM+6gswagyX68B EsgQz2AogpQGV6YyApSd4yVvvVflYWZ3A5eYbnvLR7eFdT5bEze9QwzelxbUYhCcMn7t ZA5UlDilV4Y0a2y5IquFlyJWwgOWV3GiVi7f1t4R9Qfx7XINmafYt7mPHZnHQ4TAHZNt mBlhSl0YDZYUzSo0fVq/jkunN1PJ2fnc3QazU//lq/VYprpTIVIWbF1Fg10jEABQZ+tg 3ayZJFNABGk3sHEiD+Is71HqaeQD/i2yJUFRJ2R9ym6JMgJOmpGrdlmRSRXlFIx9Hhle 0AEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=7F7KoR+pbWAeq4uRGTd/CTEkLm1sJHbvegiLLMNLvrg=; b=crRvlxsjNeKDMzn+Tk8PHsavBX15eX3dplqCyCuRJNuIDjEN8i9B7eRpY7OjFeKuqd HD1igwx8UMA2FcBRhlz4PSMXj0RYIRhLQQ7y/2iEx3xChL9SjRYqz1XZLyMyF/BU7dMq gU48vww8OdpaKGdxSOK3f2zAm6k+SVe0Cm8bjUe3ezyoQI5dbI9xFmA3k4+MalpSu9Ap zjWjmRqT7bXGLOtsHkGOlpp3ycSqvjbwbflQcKOptXii62Jt7O4QCXMMd1Xi2hKDoIok qcbXRBHlVqzcETxOLzEwa3N4u98C/oNW06KPPE6KpdCBrWfGOBZi7oBYZx8KUsKg8MTJ 5Xog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=NMafFJ4A; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b61-20020a509f43000000b00447d0d8e385si2492558edf.237.2022.08.26.21.39.52; Fri, 26 Aug 2022 21:40:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=NMafFJ4A; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242977AbiH0Ehm (ORCPT + 99 others); Sat, 27 Aug 2022 00:37:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244615AbiH0Ehf (ORCPT ); Sat, 27 Aug 2022 00:37:35 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02BDBABD7B; Fri, 26 Aug 2022 21:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=7F7KoR+pbWAeq4uRGTd/CTEkLm1sJHbvegiLLMNLvrg=; b=NMafFJ4At9KjtQl77wABCL/Itc CbLmc3DlTJMGgsA7yjMRoK6FOPoarly+OecKKVBA00SSRN1+4c7/4gdBFkJ2Mm2wm7BQ8TB4scQ2v DjWzsIIVUzyag+C9YD3w7dot6FMqkeEKfCST0oDRos84cloypWY+/DRyjNl1fRyoKbSiHb3QA5qmJ pA30cmUbkYgwZc9u4iF9wMPYIsHJFhkwvViWADFYhN6BQtFWf6D8jt9JHfX5a7Duwde/NRYxsT246 QLVrGu4lRWpswV/jB0IQvVy3e2VWToJB2g9sLDeGVMp5PXw0L4dfxprtnzIYwlXMMliIPQlVyCMq+ bziC4f8w==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oRnZT-008sPn-6J; Sat, 27 Aug 2022 04:37:23 +0000 Date: Sat, 27 Aug 2022 05:37:23 +0100 From: Al Viro To: NeilBrown Cc: Linus Torvalds , Daire Byrne , Trond Myklebust , Chuck Lever , Linux NFS Mailing List , linux-fsdevel@vger.kernel.org, LKML Subject: Re: [PATCH 08/10] NFSD: allow parallel creates from nfsd Message-ID: References: <166147828344.25420.13834885828450967910.stgit@noble.brown> <166147984376.25420.3784384336816172144.stgit@noble.brown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <166147984376.25420.3784384336816172144.stgit@noble.brown> Sender: Al Viro X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Fri, Aug 26, 2022 at 12:10:43PM +1000, NeilBrown wrote: > if (is_create_with_attrs(open)) > nfsd4_acl_to_attr(NF4REG, open->op_acl, &attrs); > + inode = d_inode(path.dentry); > > - inode_lock_nested(inode, I_MUTEX_PARENT); > + child = filename_create_one_len(open->op_fname, > + open->op_fnamelen, > + &path, 0, &wq); > > - child = lookup_one_len(open->op_fname, parent, open->op_fnamelen); > - if (IS_ERR(child)) { > - status = nfserrno(PTR_ERR(child)); > - goto out; > - } > + if (IS_ERR(child)) > + return nfserrno(PTR_ERR(child)); Leaks acls, by the look of it? > + if (!IS_PAR_UPDATE(fhp->fh_dentry->d_inode) && > + inode_trylock_shared(fhp->fh_dentry->d_inode)) { > + /* only have a shared lock */ > + inode_unlock_shared(fhp->fh_dentry->d_inode); > + fhp->fh_no_atomic_attr = true; > + fhp->fh_no_wcc = true; Er... Shouldn't that be IS_PAR_UPDATE() && ... ?