Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp462325imn; Mon, 25 Jul 2022 23:47:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uXm1B1YcMSqPa682UhXl4EPw2Nwp5QIsPlYhuh5LAO495uzj9DBZI5JF0SWUzK1Fgd2GVc X-Received: by 2002:a17:902:da87:b0:16c:56d7:e002 with SMTP id j7-20020a170902da8700b0016c56d7e002mr15780673plx.27.1658818062912; Mon, 25 Jul 2022 23:47:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658818062; cv=none; d=google.com; s=arc-20160816; b=d5bm6Ryowc6KcB3zvirMpa1/CRVvPfblBvX1bEBjzinNSz5nD0jz4KsMhDO/0kScsZ 1J74vITwTprCwVpnJsBsg94P3KkNq3ctNK2DwIIwQxcPSXt14Ul2g6IseN3jRAoUCpOr 1xtfucaNh0mMQWAS/uPEKIjESJK02WRInrUfk8Do4dQJX3pEgTz/bIgK3g+hw/4pkFlg 43/kePNpCUcR3ZZHA2U/XxsMH5LMmel4J1JI0HpWxdmnvdOEaYUIIVzC2GO9ZiGe+adP f6FLRvXoJP/IRSUqP4k4OURxWwzVKy3gT3fpW0dv7n7zU2DFXgxvj0gk/2KUCech/KUg UcfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject:dkim-signature :dkim-signature; bh=ZLzWk/qU4dU6J2EdsmsXbjIubh0L0To9Nfu6l4+1jRw=; b=SQAB7pG56AnOVqtNurUlF/1Bt6do1XW2VVvJceGF5Sunlics6IPLY8aFYYsyAE/hvq 81iGtw/CcIJoKQ9HY6idmV0o4wpLZNd+LFShx7xInnK3LtW9DlOaCsT2D9n88JbOqXvG ESPFIluE3UB5t3dYwPp3hYI+AB/ioFICSGIPM8HNZXWY9mMQMxf7uI+djOyUPmQ9vf2v I5iwAvSX1zibhDpLTGzjiFdRQtN7baBKNoI7PrHosHZGY5+HGGyPryEwIxv93M1gRV/u gf04oIGeDYVOO1sUgTfE1JGDNwRzbAhx9T8y3216UOidzEGb5nDQE3wDi8zA+aPAS5J4 naDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Y4Mr2XiF; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=CGRmacDa; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z10-20020a170903018a00b0016be8c2951esi9146128plg.459.2022.07.25.23.47.15; Mon, 25 Jul 2022 23:47:42 -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=@suse.de header.s=susede2_rsa header.b=Y4Mr2XiF; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=CGRmacDa; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237858AbiGZGqf (ORCPT + 99 others); Tue, 26 Jul 2022 02:46:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237776AbiGZGqe (ORCPT ); Tue, 26 Jul 2022 02:46:34 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C84201EAFE for ; Mon, 25 Jul 2022 23:46:33 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 58F1834595; Tue, 26 Jul 2022 06:46:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1658817991; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZLzWk/qU4dU6J2EdsmsXbjIubh0L0To9Nfu6l4+1jRw=; b=Y4Mr2XiFAizUMzVm6snJzUptOPLlswdBwM5JCB6OsB1raoMvZrTbpmL8VzO4Da1BP9SEb4 2V8MJu2huFtXslR64rmKghPSqn8Wdx9o5aQpxGUgQN63nBl/ZPoCclAbEnvyj+/vcBjajr AbGX0ar+38vAeWAbSEN0t/bxvsx9hNI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1658817991; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZLzWk/qU4dU6J2EdsmsXbjIubh0L0To9Nfu6l4+1jRw=; b=CGRmacDaAwtpczwtSm3yBnyBQK46aKzu3PhhHaE9uxMbDcXK9vD2tIDThwSNb+XUjZq7+F 4C5tOC+YTC/jz9AQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3E84713A7C; Tue, 26 Jul 2022 06:46:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 5sjKOsWN32IiWAAAMHmgww (envelope-from ); Tue, 26 Jul 2022 06:46:29 +0000 Subject: [PATCH 00/13] NFSD: clean up locking From: NeilBrown To: Chuck Lever III , Jeff Layton Cc: Linux NFS Mailing List Date: Tue, 26 Jul 2022 16:45:30 +1000 Message-ID: <165881740958.21666.5904057696047278505.stgit@noble.brown> User-Agent: StGit/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 This is the latest version of my series to clean up locking - particularly of directories - in preparation for proposed patches which change how directory locking works across the VFS. I've included Jeff's patches to validate the dentry after getting a delegation. The second patch has been changed quite a bit to use nfsd_lookup_dentry(). I've left Jeff's From: line in place - let me know if you'd rather I change it. Setting of ACLs and security labels has been moved from nfs4 code to nfsd_setattr() which allows quite a lot of code cleanup. I think I've addressed all the concerns that have been raised, though maybe not in the way that was suggested. I've tested this with cthon tests over v2, v3, v4.0, v4.1, and xfstests on v3 and v4.1, and pynfs 4.0, 4.1. No problems appeared. Thanks, NeilBrown --- Jeff Layton (2): NFSD: drop fh argument from alloc_init_deleg NFSD: verify the opened dentry after setting a delegation NeilBrown (11): NFSD: introduce struct nfsd_attrs NFSD: set attributes when creating symlinks NFSD: add security label to struct nfsd_attrs NFSD: add posix ACLs to struct nfsd_attrs NFSD: change nfsd_create()/nfsd_symlink() to unlock directory before returning. NFSD: always drop directory lock in nfsd_unlink() NFSD: only call fh_unlock() once in nfsd_link() NFSD: reduce locking in nfsd_lookup() NFSD: use explicit lock/unlock for directory ops NFSD: use (un)lock_inode instead of fh_(un)lock for file operations NFSD: discard fh_locked flag and fh_lock/fh_unlock fs/nfsd/acl.h | 6 +- fs/nfsd/nfs2acl.c | 6 +- fs/nfsd/nfs3acl.c | 4 +- fs/nfsd/nfs3proc.c | 25 ++--- fs/nfsd/nfs4acl.c | 46 ++------- fs/nfsd/nfs4proc.c | 153 ++++++++++++----------------- fs/nfsd/nfs4state.c | 71 +++++++++++--- fs/nfsd/nfsfh.c | 22 ++++- fs/nfsd/nfsfh.h | 58 +---------- fs/nfsd/nfsproc.c | 19 ++-- fs/nfsd/vfs.c | 230 +++++++++++++++++++++----------------------- fs/nfsd/vfs.h | 31 ++++-- fs/nfsd/xdr4.h | 1 + 13 files changed, 314 insertions(+), 358 deletions(-) -- Signature