All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever III <chuck.lever@oracle.com>
To: Dave Wysochanski <dwysocha@redhat.com>
Cc: Bruce Fields <bfields@fieldses.org>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/1] nfsd4: Expose the callback address and state of each NFS4 client
Date: Fri, 14 May 2021 15:06:00 +0000	[thread overview]
Message-ID: <161942E6-C5AD-47AC-BDFE-34C428349E98@oracle.com> (raw)
In-Reply-To: <1620999041-9341-2-git-send-email-dwysocha@redhat.com>

Howdy Dave-

> On May 14, 2021, at 9:30 AM, Dave Wysochanski <dwysocha@redhat.com> wrote:
> 
> In addition to the client's address, display the callback channel
> state and address in the 'info' file.
> 
> Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
> ---
> fs/nfsd/nfs4state.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 49c052243b5c..89a7cada334d 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -2357,6 +2357,21 @@ static void seq_quote_mem(struct seq_file *m, char *data, int len)
> 	seq_printf(m, "\"");
> }
> 
> +static const char *cb_state_str(int state)
> +{
> +	switch (state) {
> +		case NFSD4_CB_UP:
> +			return "UP";
> +		case NFSD4_CB_UNKNOWN:
> +			return "UNKNOWN";
> +		case NFSD4_CB_DOWN:
> +			return "DOWN";
> +		case NFSD4_CB_FAULT:
> +			return "FAULT";

No objection to the addition of this information. Style nit:
the "case" and "switch" lines should have the same amount of
indentation.


> +	}
> +	return "UNDEFINED";
> +}
> +
> static int client_info_show(struct seq_file *m, void *v)
> {
> 	struct inode *inode = m->private;
> @@ -2385,6 +2400,8 @@ static int client_info_show(struct seq_file *m, void *v)
> 		seq_printf(m, "\nImplementation time: [%lld, %ld]\n",
> 			clp->cl_nii_time.tv_sec, clp->cl_nii_time.tv_nsec);
> 	}
> +	seq_printf(m, "callback state: %s\n", cb_state_str(clp->cl_cb_state));
> +	seq_printf(m, "callback address: %pISpc\n", &clp->cl_cb_conn.cb_addr);
> 	drop_client(clp);
> 
> 	return 0;
> -- 
> 1.8.3.1
> 

--
Chuck Lever




  reply	other threads:[~2021-05-14 15:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14 13:30 [PATCH 0/1] Add callback address and state to nfsd client info Dave Wysochanski
2021-05-14 13:30 ` [PATCH 1/1] nfsd4: Expose the callback address and state of each NFS4 client Dave Wysochanski
2021-05-14 15:06   ` Chuck Lever III [this message]
2021-05-14 16:25     ` David Wysochanski
2021-05-14 14:15 ` [PATCH 0/1] Add callback address and state to nfsd client info Bruce Fields
2021-05-14 16:41   ` David Wysochanski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=161942E6-C5AD-47AC-BDFE-34C428349E98@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=bfields@fieldses.org \
    --cc=dwysocha@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.