Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7415363yba; Thu, 2 May 2019 09:26:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzT1YrgiY0PrjsJt+fHiFf3f07n+xfPyfA361uRg69nQ2UBI2DEIYX+P/r6xDB1GXEZvw7v X-Received: by 2002:a17:902:6b47:: with SMTP id g7mr4607627plt.227.1556814361721; Thu, 02 May 2019 09:26:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556814361; cv=none; d=google.com; s=arc-20160816; b=VornScbAheL9iKArO0wkjpgqnxF92bUKmikFnfZDt4FP8W2NmqqJZRRM36NJjD4igC jaLoRaVJe/P3qChxPIcaVFAQLhLum42v7idiExbV53VneqEHsjFGvlFo+4HWa8zslnsV U8nDt0cmpvJA3ZSpoGwxr35TnKipB7UlXNloaWH4FwwIcrNs/bfT7TUoylAMG1MnWyWP dxiMouSeI1h7EQp5D6JZBAMI9iaMN1e1KojtiSWtXT+Sbh7CS12BM7v3l5UYPbzw1Mir fU0Gd3/Q1/OBbZ9SomjnvgretDj5axjNWNF5JxO2qXbjQMHKC5tXZMJaWsnT6oS0wcxn vSAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=k5AiCLNn3xHPEfyat85hfeYYvR9J+Cd6jkR+T2tj7Tk=; b=BouMr8BF0WMjoD533PuJNe22bQfy4k7oxC6pqHKbzYCpgy7PeVlD2KGnDUoqVKZTZJ ZSVzauYKdD9+WsKHwfPDTaycN2mwsaAK1Ign+HiQu09OaM3tCyBfCcH++OSfUQWnqbE+ EgfESBpCJ4DWeHJzdE3wapCCcuQ1Ylf+QBcxe9qDuJyWiR2IoAiqbqwGGrJJfH8+epNt mu4LXj41QzhoF1mvIhXBlJi/ARLoKMhHkGnTajWOzlGNrLNR5dXmiW0CAZJJg132Li02 DfkTRwh87e2fEBN+IsLb+Bqj1C+RM7MaWX1D1lI3WTP4lXJVKyO8IeJt2GzMINpqSUTi TKmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si43451807pfm.179.2019.05.02.09.25.37; Thu, 02 May 2019 09:26:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726393AbfEBQYt (ORCPT + 99 others); Thu, 2 May 2019 12:24:49 -0400 Received: from discipline.rit.edu ([129.21.6.207]:33426 "HELO discipline.rit.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726383AbfEBQYt (ORCPT ); Thu, 2 May 2019 12:24:49 -0400 Received: (qmail 84036 invoked by uid 501); 2 May 2019 15:58:06 -0000 From: Andrew W Elble To: Benjamin Coddington Cc: "J. Bruce Fields" , , , , , , Subject: Re: [PATCH 09/10] nfsd: expose some more information about NFSv4 opens References: <1556201060-7947-1-git-send-email-bfields@redhat.com> <1556201060-7947-10-git-send-email-bfields@redhat.com> <786E0C83-A22D-461A-A9D1-AF7B42018CE9@redhat.com> Date: Thu, 02 May 2019 11:58:06 -0400 In-Reply-To: <786E0C83-A22D-461A-A9D1-AF7B42018CE9@redhat.com> (Benjamin Coddington's message of "Thu, 2 May 2019 11:28:31 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Benjamin Coddington writes: > On 25 Apr 2019, at 10:04, J. Bruce Fields wrote: > >> From: "J. Bruce Fields" >> >> Add open modes, device numbers, inode numbers, and open owners to each >> line of nfsd/clients/#/opens. >> >> Open owners are totally opaque but seem to sometimes have some useful >> ascii strings included, so passing through printable ascii characters >> and escaping the rest seems useful while still being machine-readable. >> --- >> fs/nfsd/nfs4state.c | 40 >> ++++++++++++++++++++++++++++------ >> fs/nfsd/state.h | 2 +- >> fs/seq_file.c | 17 +++++++++++++++ >> include/linux/seq_file.h | 2 ++ >> include/linux/string_helpers.h | 1 + >> lib/string_helpers.c | 5 +++-- >> 6 files changed, 57 insertions(+), 10 deletions(-) >> >> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c >> index 829d1e5440d3..f53621a65e60 100644 >> --- a/fs/nfsd/nfs4state.c >> +++ b/fs/nfsd/nfs4state.c >> @@ -42,6 +42,7 @@ >> #include >> #include >> #include >> +#include >> #include "xdr4.h" >> #include "xdr4cb.h" >> #include "vfs.h" >> @@ -2261,16 +2262,41 @@ static void opens_stop(struct seq_file *s, >> void *v) >> static int opens_show(struct seq_file *s, void *v) >> { >> struct nfs4_stid *st = v; >> - struct nfs4_ol_stateid *os; >> - u64 stateid; >> + struct nfs4_ol_stateid *ols; >> + struct nfs4_file *nf; >> + struct file *file; >> + struct inode *inode; >> + struct nfs4_stateowner *oo; >> + unsigned int access, deny; >> >> if (st->sc_type != NFS4_OPEN_STID) >> return 0; /* XXX: or SEQ_SKIP? */ >> - os = openlockstateid(st); >> - /* XXX: get info about file, etc., here */ >> + ols = openlockstateid(st); >> + oo = ols->st_stateowner; >> + nf = st->sc_file; >> + file = find_any_file(nf); Is there a matching fput() missing somewhere, or did I just not see it...? >> + inode = d_inode(file->f_path.dentry); >> + >> + seq_printf(s, STATEID_FMT, STATEID_VAL(&st->sc_stateid)); > > Should we match the byte order printed with what wireshark/tshark sees? ^^ +1 Thanks, Andy -- Andrew W. Elble Infrastructure Engineer Information and Technology Services Rochester Institute of Technology tel: (585)-475-2411 | aweits@rit.edu PGP: BFAD 8461 4CCF DC95 DA2C B0EB 965B 082E 863E C912 CONFIDENTIALITY NOTE: The information transmitted, including attachments, is intended only for the person(s) or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and destroy any copies of this information.