From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from neil.brown.name (neil.brown.name [103.29.64.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE4C82376F5 for ; Fri, 20 Jun 2025 23:39:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.29.64.221 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750462752; cv=none; b=sp7OUcRDepBCxajWmiNjjqb7I8pYgeGVtirk5zr4ASWX4Io9+vpHo8zhpcNpZKrFd9Mkb195f3n7rj3FN8J+w2jQNnruyDgwhQzE9vyGCIzGM5+2eA8IwIlLakD9f9huUeKAnXqhFv/00AJ8gb0c5MGvT/eF55aVjmtRD0OAt2s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750462752; c=relaxed/simple; bh=dyGijIe7KMWVmo09J8aO/4HSChpYfSDOUU2UxtH6IoQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=uuUWGOd70Ul0wT2xXoyIZTK8vf3pjTttUF+P5IqDrluZ5/WOPNFDXYSSvwE41RkNNz4RnsHlAQuB8AKBljP3Xe9ImtZV3+9vzZGstqu9WnCG8ax5cpuuN0iMu+2vzK04Mfr3ZW8JJQIh+DY29NR8wUY2RmqwxFjHXE42gazpjeg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=brown.name; spf=pass smtp.mailfrom=neil.brown.name; arc=none smtp.client-ip=103.29.64.221 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=brown.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=neil.brown.name Received: from 196.186.233.220.static.exetel.com.au ([220.233.186.196] helo=home.neil.brown.name) by neil.brown.name with esmtp (Exim 4.95) (envelope-from ) id 1uSlJy-0023qH-Gm; Fri, 20 Jun 2025 23:38:58 +0000 From: NeilBrown To: Chuck Lever , Jeff Layton Cc: linux-nfs@vger.kernel.org, Olga Kornievskaia , Dai Ngo , Tom Talpey , Li Lingfeng Subject: [PATCH 0/3 RFC] improve some nfsd_mutex locking Date: Sat, 21 Jun 2025 09:33:23 +1000 Message-ID: <20250620233802.1453016-1-neil@brown.name> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The first patch hopefully fixes a bug with locking as reported by Li Lingfeng: some write_foo functions aren't locked properly. The other two improve the locking code, particulary so that we don't need a global mutex to change per-netns data. I've revised the locking to use guard(mutex) for (almost) all places that the per-netfs mutex is used. I think this is an improvement but would like to know what others think. I haven't changed _get/_put to _pin/_unpin as Chuck wondered about. I'm not against that (though get/put are widely understood) but nor am I particularly for it yet. Again, opinions are welcome. NeilBrown [PATCH 1/3] nfsd: provide proper locking for all write_ function [PATCH 2/3] nfsd: use kref and new mutex for global config management [PATCH 3/3] nfsd: split nfsd_mutex into one mutex per net-namespace.