Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1723762pxf; Fri, 19 Mar 2021 14:12:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw27jx4pAky/hpb6XY6s2J1FxQKOSDe2mBZGs7QEbxYs2gOiz6AwGRIyDqDmR8EZfnAIeqk X-Received: by 2002:a05:6402:10c9:: with SMTP id p9mr12029357edu.268.1616188370548; Fri, 19 Mar 2021 14:12:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616188370; cv=none; d=google.com; s=arc-20160816; b=H1XR/5Vc4mxS1jvdoi5iLpHdiS+Q4nsepKafQ+ZQFiHRr2RoDPgxzmxpSiMRNKqHwF E+A8XD1ofw1/XppuzQLkcfiUiImXvbClprsFjIC7K0BGrGIHOpGWz+oon4nNWgVaFlX9 d5222OZh5OWJ663+Xchi1seYsvl9VjlHiwM8nhKTdu6HjjOynOtVJfz1uLU/jbPHXsAQ Rj8BZsl8jGu3BRHrKGzx0BnNx63y6CA5d9HVurJbwIMX8SjWjG0UR49JuTdQY3v0d2jG B3n2gne48whIFhdu2hDihGkTj1CuDkFIgYJsShSLiNBp5fZWBElN7bGqecR11verkr9g Rx2w== 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=g2HJdbNUupoE9a0ENwByUSuYXPNrr/JuCRoW0pm6F3g=; b=yLYu0WVRJcVdfcz09WSQeiXS/82VE0h7LM30HrIhmi1tLAbctJiTDCYH8pwlWsfLHs 8CZA0eySfywc6HPqP/1jWp6+ql9X5qzctCE9/q7KCcJSTUrF3srOqH8m2d6yy4knbyAx Ra/jyH9GID4g0rk/lpVKFr+1fYaVKvnzFaNa2MZ4rSn0qZSOpM+jKt01LLoN8eO8tTBW AJL1rLWAPg3+T87w/IJFjO74i1HEfNJpqjcLK4gNAsHZDlfwa476cAyRlg+AxwIuviZN +Uv44KYc/lEslEUDkRLmHqlFuGUf1LPTrobL1I/341YA1YZvam8MAVwY+y4rLcTQ4dkH uB7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=BtdLpeH2; 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 d21si4958229ejw.331.2021.03.19.14.12.19; Fri, 19 Mar 2021 14:12:50 -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=BtdLpeH2; 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 S229912AbhCSVJq (ORCPT + 99 others); Fri, 19 Mar 2021 17:09:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230394AbhCSVJY (ORCPT ); Fri, 19 Mar 2021 17:09:24 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E8CAC06175F for ; Fri, 19 Mar 2021 14:09:24 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id DA39823D8; Fri, 19 Mar 2021 17:09:22 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org DA39823D8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1616188162; bh=g2HJdbNUupoE9a0ENwByUSuYXPNrr/JuCRoW0pm6F3g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BtdLpeH2sKcIVRytmoAG0v3YfvDtRL8ooI3GoUCkU68nHwKKgjj/A8/n3ZWo71qOS h6Xwwfx2UEoLk1Oy5iwWlmkxiWX7ICHMACUZrb29m7r4jYZEINW+iJ0LNTwSO2icjW RoM7V9FCWejjUP6FDdQB6VP+WS9K8egJsuizQGl8= Date: Fri, 19 Mar 2021 17:09:22 -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: <20210319210922.GD31533@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87lfaieuoj.fsf@notabene.neil.brown.name> User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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.... --b.