diff options
author | J. Bruce Fields <bfields@redhat.com> | 2019-06-19 12:39:46 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2019-07-03 17:52:50 -0400 |
commit | 169319f13cb874e90471463ba4a8d5689c23de2d (patch) | |
tree | a4a06ea65135411dca8ff3366cd4b923a37be226 /fs/nfsd | |
parent | ea053e164cc812f0c00a58cbbf8c65e27ceb6148 (diff) |
nfsd: add more information to client info file
Add ip address, full client-provided identifier, and minor version.
There's much more that could possibly be useful but this is a start.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4state.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index c2cbf14e010d..ed14572e739c 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/sunrpc/svcauth_gss.h> | 42 | #include <linux/sunrpc/svcauth_gss.h> |
43 | #include <linux/sunrpc/addr.h> | 43 | #include <linux/sunrpc/addr.h> |
44 | #include <linux/jhash.h> | 44 | #include <linux/jhash.h> |
45 | #include <linux/string_helpers.h> | ||
45 | #include "xdr4.h" | 46 | #include "xdr4.h" |
46 | #include "xdr4cb.h" | 47 | #include "xdr4cb.h" |
47 | #include "vfs.h" | 48 | #include "vfs.h" |
@@ -2214,6 +2215,13 @@ find_stateid_by_type(struct nfs4_client *cl, stateid_t *t, char typemask) | |||
2214 | return s; | 2215 | return s; |
2215 | } | 2216 | } |
2216 | 2217 | ||
2218 | static void seq_quote_mem(struct seq_file *m, char *data, int len) | ||
2219 | { | ||
2220 | seq_printf(m, "\""); | ||
2221 | seq_escape_mem_ascii(m, data, len); | ||
2222 | seq_printf(m, "\""); | ||
2223 | } | ||
2224 | |||
2217 | static int client_info_show(struct seq_file *m, void *v) | 2225 | static int client_info_show(struct seq_file *m, void *v) |
2218 | { | 2226 | { |
2219 | struct inode *inode = m->private; | 2227 | struct inode *inode = m->private; |
@@ -2227,6 +2235,10 @@ static int client_info_show(struct seq_file *m, void *v) | |||
2227 | clp = container_of(nc, struct nfs4_client, cl_nfsdfs); | 2235 | clp = container_of(nc, struct nfs4_client, cl_nfsdfs); |
2228 | memcpy(&clid, &clp->cl_clientid, sizeof(clid)); | 2236 | memcpy(&clid, &clp->cl_clientid, sizeof(clid)); |
2229 | seq_printf(m, "clientid: 0x%llx\n", clid); | 2237 | seq_printf(m, "clientid: 0x%llx\n", clid); |
2238 | seq_printf(m, "address: \"%pISpc\"\n", (struct sockaddr *)&clp->cl_addr); | ||
2239 | seq_printf(m, "name: "); | ||
2240 | seq_quote_mem(m, clp->cl_name.data, clp->cl_name.len); | ||
2241 | seq_printf(m, "\nminor version: %d\n", clp->cl_minorversion); | ||
2230 | drop_client(clp); | 2242 | drop_client(clp); |
2231 | 2243 | ||
2232 | return 0; | 2244 | return 0; |