Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp913423pxf; Wed, 7 Apr 2021 14:55:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+zZFmRGjtWxExlMLaFfkIVdP2I/6UPIqh5I5ZRcvRo2DM25jopqg17YqWIkRC/58XtI+E X-Received: by 2002:a50:cd0b:: with SMTP id z11mr335109edi.209.1617832556031; Wed, 07 Apr 2021 14:55:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617832556; cv=none; d=google.com; s=arc-20160816; b=SFC4/94lgqFdQMHWQ9l6lTjrZfWUCdRnNgeiqO2+500K1rxXHdCJbWBj9khNyow6/n S9aeBIhfzjdKriWw29jSGOK2jgFchkQTm8vbLIy8Zq5ZMhLhnHzSthK88nuwRN/AqsV5 HtFhSsc0udKgEyzhltHSqMFqrjhYuptBFMeNFDMz3oZrt7NGKeaCPnLE4EeunOaX8Bgs bdVEADDvIqcCuAAVSYiCfWIckqeIFO0VFoU7NbEL4REzF2U8N9Gy3ebFUZ/iIt1z+1w9 /CH2XS0UGhKB+ZRZPqwhlO4LtWFWEi6pq2Km5L/4ZFXA0UPJsc8yHuXRqx7q0oRccbbN 5QbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=Gv9dPIwJx66BKvpyd17YWXFAtBD3wEg3XSsOKYAv1lg=; b=zEUnZJ2SxEnE8H1KULuYbgwpqpv2mnlvgG8yEPAye6V7Cslkb8WLKNL2c1F2IY6Ypn Q6vsLK2B+foG20mnUN2LNRvQudPnKitKXxP7HJT4wjcB5gqoDtj6SZgMV3jqE602vYws y8oloJdbQYC2XIA7pbwGmqHS+7DhkNds3Vk2k3krko0t4Opeq9rsI0dMFMAGgQZxOaPu V23MM4+CFCPc6t7EMsOaB3Z09QHz7SvrBUVCbTFXPQTPM5hIlnVBVngtY0Ep7y/XotB4 g3GKu7oYzO7yWC8K1jyRecIIuZEIVcD97qvXJrtHxWBl6ArE0DwTkzAMPpOV6sMvCpo5 98ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=UkFQfmt7; 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 z22si19321499edc.427.2021.04.07.14.55.33; Wed, 07 Apr 2021 14:55:55 -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=@fieldses.org header.s=default header.b=UkFQfmt7; 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 S1345052AbhDGTPC (ORCPT + 99 others); Wed, 7 Apr 2021 15:15:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbhDGTPB (ORCPT ); Wed, 7 Apr 2021 15:15:01 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 265EEC06175F for ; Wed, 7 Apr 2021 12:14:52 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id 206FD6A45; Wed, 7 Apr 2021 15:14:51 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 206FD6A45 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1617822891; bh=Gv9dPIwJx66BKvpyd17YWXFAtBD3wEg3XSsOKYAv1lg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UkFQfmt7Qeeh+uKWN61RoFqp812Q5sTmIKMIjQpEHa6K0cwoB96uaEvpvYSVJdW85 5m+zf5O+n9h59mTuUk1DzH3VjrxufXP24gx9/tUlwWIH/or5MvcCRdLwJcZLFf6FCZ lEGsbtuCqNmZY+Z7W8Bt7ayQ04OHeHbX2hYB0l8U= Date: Wed, 7 Apr 2021 15:14:51 -0400 From: "J. Bruce Fields" To: NeilBrown Cc: Steve Dickson , Linux NFS Mailing list Subject: Re: [PATCH 0/5 v2] nfs-utils: provide audit-logging of NFSv4 access Message-ID: <20210407191451.GA3663@fieldses.org> References: <161456493684.22801.323431390819102360.stgit@noble> <20210301185037.GB14881@fieldses.org> <874khui7hr.fsf@notabene.neil.brown.name> <20210302032733.GC16303@fieldses.org> <87y2ejerwn.fsf@notabene.neil.brown.name> <20210319132820.GA31533@fieldses.org> <87lfaieuoj.fsf@notabene.neil.brown.name> <20210319210922.GD31533@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210319210922.GD31533@fieldses.org> User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Fri, Mar 19, 2021 at 05:09:22PM -0400, J. Bruce Fields wrote: > On Sat, Mar 20, 2021 at 07:48:44AM +1100, NeilBrown wrote: > > On Fri, Mar 19 2021, J. Bruce Fields wrote: > > > > > On Fri, Mar 19, 2021 at 02:36:24PM +1100, NeilBrown wrote: > > >> On Mon, Mar 01 2021, J. Bruce Fields wrote: > > >> > > >> > On Tue, Mar 02, 2021 at 02:01:36PM +1100, NeilBrown wrote: > > >> >> On Mon, Mar 01 2021, J. Bruce Fields wrote: > > >> >> > > >> >> > I've gotten requests for similar functionality, and intended to > > >> >> > implement it using directory notifications on /proc/fs/nfsd/clients. > > >> >> > > >> >> I've been exploring this a bit. > > >> >> When I mount a filesystem, 2 clients get created. > > >> >> With NFSv4.0, the second client is immediately deleted, and the first > > >> >> client is deleted one grace period after the filesystem is unmounted. > > >> >> With NFSv4.1 and 4.2, the first client is immediately deleted, and the > > >> >> second client is deleted immediately after the unmount. > > >> > > > >> > Yeah, internally it's creating an "unconfirmed client" on SETCLIENTID > > >> > (or EXCHANGE_ID) and then a new "confirmed client" on > > >> > SETCLIENTID_CONFIRM (or CREATE_SESSION). > > >> > > > >> > I'm not sure why the ordering's a little different between the 4.0/4.1+ > > >> > cases. > > >> > > >> The multiple clients are not really nfsd's "fault". The Linux NFS > > >> client sends multiple EXCHANGE_ID or SET_CLIENT_ID requests, so NFSD > > >> really does need to create multiple clients. > > >> > > >> For NFSv4.0, when nfsd gets a repeat SET_CLIENT_ID, it keeps the old one > > >> and discards the new. > > >> For NFSv4.1, the spec requires that it keep the new one and discard the > > >> old. > > >> This explains the different ordering. > > > > > > Hm, is this the client's trunking-detection logic? > > > > Yes. > > > > > > > > In which case, it's not just unconfirmed clients. > > > > For NFSv4.1, only the EXCHANGE_ID is duplicate. There is only one > > CREATE_SESSION, and that is where the client is confirmed. So only one > > confirmed client. > > > > For NFSv4.0 bother SETCLIENTID and SETCLIENDID_CONFIRM are duplicate. > > So maybe both clients get confirmed. I should check that. > > Drifting off topic, but I don't see how this client behavior makes > sense. Mount is chatty enough without the unnecessary duplication. > Looking at the code.... I never sorted this out, by the way. I think there must be a bug, though. --b.