Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1397963pxf; Fri, 19 Mar 2021 06:30:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyG1fICqbMsdQVhhWJ8FlQAMbLjAaJDaxIhAFW+9eOd4Twm6DRPZ/ZUsak8uYqn35bmNVGf X-Received: by 2002:a17:906:845b:: with SMTP id e27mr4255593ejy.487.1616160618239; Fri, 19 Mar 2021 06:30:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616160618; cv=none; d=google.com; s=arc-20160816; b=scM299dc2PqR80wbIpg3cirQhjo2ofZM3fN1wnywm5CTY8b7Ouk7l8q4fQ6P76OrL9 GDCH0474mnIhlHeQhIR9w3gpvwV+I/kc6f2f+rJkEv9M5icjTkH7RSCE+sbnXKRSeMAl ObIzK8k5q4ZDayF1qL8/R0JZJxW0qLoBbXdwludrdKi7zplOeJyUKutZxVX+jwbQZmO6 Nmmb6cnTtdSWsMHVKM17BWC9tiuX2n7Fb1aMZrnboVLM66UNp4+R4xQm4yei9pHY0SbB jbFTFBKiuLsoQ4w8HswP81AWdQVgcX7hWuJ+jZXVWpdBYbE3n8yz3Zjs1VY6DzKlM25K FmeA== 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=2N88ujI77SIKWOZ3syRrofcGqQUfzRdk+IqXJmkI3AA=; b=fVEtxDndjQp0vRtHGYskUHGriN2m5qUUw+BnrOHML3m/mNoUfaW5U8ACFSF7HYGZoR 39kWqdqTXL+roWS9clhXW41oWpNyfzR+F8+CPUFtSXH1XgcYlszBc4PPwlzfdpG659Ie HeL8rDNtsN5LWXFenhdTEoMq7B6YyPJSVesUbiyxP4gb1J9gxAoQBdBcJPpilEAP9v7t v6pyiKcS8O6h49v2lI2cQYpiOyfxnOzHJfqfNFruOUmoKjTb7VliY4Y/8k0R8sYIlzqm U6IDQWHXek/S2KYoAIVR8uv95jI0Enrluy/2Da6pJa2IgwOgaPYKEWBxBkP/utYPFqo8 iW/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=uvufseJR; 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 yk13si4098269ejb.127.2021.03.19.06.29.44; Fri, 19 Mar 2021 06:30:18 -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=uvufseJR; 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 S229821AbhCSN3F (ORCPT + 99 others); Fri, 19 Mar 2021 09:29:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbhCSN2d (ORCPT ); Fri, 19 Mar 2021 09:28:33 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82D32C06174A for ; Fri, 19 Mar 2021 06:28:21 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id 2FE7423D8; Fri, 19 Mar 2021 09:28:20 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 2FE7423D8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1616160500; bh=2N88ujI77SIKWOZ3syRrofcGqQUfzRdk+IqXJmkI3AA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uvufseJRQc1Jr8R0BQS7ly+ayzMUW+prHpoDtXGotyUo+9J2JxwBpQ3PDwvCi2kna 12wjTNh4wfEtngxScwuKI6gTEEOf0VBzRnVJF7ICQHr/oshKTYfWxZNXx+IohLtzJc QRvFkyBolGVjLNyJ6YSysETHM4Jl12klD8Cnj7qg= Date: Fri, 19 Mar 2021 09:28:20 -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: <20210319132820.GA31533@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87y2ejerwn.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 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? In which case, it's not just unconfirmed clients. > So the clean up the logging, mountd needs to be able to see the > confirmation status. That sounds fine. (The other possibility might be to just not expose clients till they're confirmed. I don't know if unconfirmed clients are really that interesting. But I guess I'd rather err on the side of exposing more information here.) > Following this reply will be a patch to nfsd to provide this status, and > a patch to mountd/exportd to use this status.