Send the nfs implementation id in EXCHANGE_ID requests unless the module
parameter nfs.send_implementation_id is 0.
This adds a CONFIG variable for the nii_domain that defaults to "kernel.org".
Signed-off-by: Weston Andros Adamson <[email protected]>
---
Update: Applied Trond's comments
Documentation/kernel-parameters.txt | 9 +++++++
fs/nfs/Kconfig | 12 ++++++++++
fs/nfs/nfs4xdr.c | 41 +++++++++++++++++++++++++++++++++-
3 files changed, 60 insertions(+), 2 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 1d369c6..7bae0fd 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1678,6 +1678,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
back to using the idmapper.
To turn off this behaviour, set the value to '0'.
+ nfs.send_implementation_id =
+ [NFSv4.1] Send client implementation identification
+ information in exchange_id requests.
+ If zero, no implementation identification information
+ will be sent.
+ The default is to send the implementation identification
+ information.
+
+
nmi_debug= [KNL,AVR32,SH] Specify one or more actions to take
when a NMI is triggered.
Format: [state][,regs][,debounce][,die]
diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig
index ee86cfc..7bce64c 100644
--- a/fs/nfs/Kconfig
+++ b/fs/nfs/Kconfig
@@ -99,6 +99,18 @@ config PNFS_OBJLAYOUT
depends on NFS_FS && NFS_V4_1 && SCSI_OSD_ULD
default m
+config NFS_V4_1_IMPLEMENTATION_ID_DOMAIN
+ string "NFSv4.1 Implementation ID Domain"
+ depends on NFS_V4_1
+ default "kernel.org"
+ help
+ This option defines the domain portion of the implementation ID that
+ may be sent in the NFS exchange_id operation. The value must be in
+ the format of a DNS domain name and should be set to the DNS domain
+ name of the distribution.
+ If the NFS client is unchanged from the upstream kernel, this
+ option should be set to the default "kernel.org".
+
config ROOT_NFS
bool "Root file system on NFS"
depends on NFS_FS=y && IP_PNP
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index ae78343..d824aed 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -44,6 +44,8 @@
#include <linux/pagemap.h>
#include <linux/proc_fs.h>
#include <linux/kdev_t.h>
+#include <linux/module.h>
+#include <linux/utsname.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/msg_prot.h>
#include <linux/sunrpc/gss_api.h>
@@ -271,7 +273,12 @@ static int nfs4_stat_to_errno(int);
1 /* flags */ + \
1 /* spa_how */ + \
0 /* SP4_NONE (for now) */ + \
- 1 /* zero implemetation id array */)
+ 1 /* implementation id array of size 1 */ + \
+ 1 /* nii_domain */ + \
+ XDR_QUADLEN(NFS4_OPAQUE_LIMIT) + \
+ 1 /* nii_name */ + \
+ XDR_QUADLEN(NFS4_OPAQUE_LIMIT) + \
+ 3 /* nii_date */)
#define decode_exchange_id_maxsz (op_decode_hdr_maxsz + \
2 /* eir_clientid */ + \
1 /* eir_sequenceid */ + \
@@ -838,6 +845,12 @@ const u32 nfs41_maxread_overhead = ((RPC_MAX_HEADER_WITH_AUTH +
XDR_UNIT);
#endif /* CONFIG_NFS_V4_1 */
+static unsigned short send_implementation_id = 1;
+
+module_param(send_implementation_id, ushort, 0644);
+MODULE_PARM_DESC(send_implementation_id,
+ "Send implementation ID with NFSv4.1 exchange_id");
+
static const umode_t nfs_type2fmt[] = {
[NF4BAD] = 0,
[NF4REG] = S_IFREG,
@@ -1766,6 +1779,8 @@ static void encode_exchange_id(struct xdr_stream *xdr,
struct compound_hdr *hdr)
{
__be32 *p;
+ char impl_name[NFS4_OPAQUE_LIMIT];
+ int len = 0;
p = reserve_space(xdr, 4 + sizeof(args->verifier->data));
*p++ = cpu_to_be32(OP_EXCHANGE_ID);
@@ -1776,7 +1791,29 @@ static void encode_exchange_id(struct xdr_stream *xdr,
p = reserve_space(xdr, 12);
*p++ = cpu_to_be32(args->flags);
*p++ = cpu_to_be32(0); /* zero length state_protect4_a */
- *p = cpu_to_be32(0); /* zero length implementation id array */
+
+ if (send_implementation_id &&
+ sizeof(CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN) > 1 &&
+ sizeof(CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN)
+ <= NFS4_OPAQUE_LIMIT + 1)
+ len = snprintf(impl_name, sizeof(impl_name), "%s %s %s %s",
+ utsname()->sysname, utsname()->release,
+ utsname()->version, utsname()->machine);
+
+ if (len > 0) {
+ *p = cpu_to_be32(1); /* implementation id array length=1 */
+
+ encode_string(xdr,
+ sizeof(CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN) - 1,
+ CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN);
+ encode_string(xdr, len, impl_name);
+ /* just send zeros for nii_date - the date is in nii_name */
+ p = reserve_space(xdr, 12);
+ p = xdr_encode_hyper(p, 0);
+ *p = cpu_to_be32(0);
+ } else
+ *p = cpu_to_be32(0); /* implementation id array length=0 */
+
hdr->nops++;
hdr->replen += decode_exchange_id_maxsz;
}
--
1.7.4.4
On Feb 16, 2012, at 3:43 PM, Myklebust, Trond wrote:
> On Thu, 2012-02-16 at 11:17 -0500, Weston Andros Adamson wrote:
>> server_scope would never be freed if nfs4_check_cl_exchange_flags() returned
>> non-zero
>>
>> Signed-off-by: Weston Andros Adamson <[email protected]>
>> ---
>> fs/nfs/nfs4proc.c | 15 +++++++++------
>> 1 files changed, 9 insertions(+), 6 deletions(-)
>>
>> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
>> index 87c584d..20c3bb0 100644
>> --- a/fs/nfs/nfs4proc.c
>> +++ b/fs/nfs/nfs4proc.c
>> @@ -4945,8 +4945,10 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
>> clp->cl_rpcclient->cl_auth->au_flavor);
>>
>> res.server_scope = kzalloc(sizeof(struct server_scope), GFP_KERNEL);
>> - if (unlikely(!res.server_scope))
>> - return -ENOMEM;
>> + if (unlikely(!res.server_scope)) {
>> + status = -ENOMEM;
>> + goto out;
>> + }
>>
>> status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT);
>> if (!status)
>> @@ -4963,12 +4965,13 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
>> clp->server_scope = NULL;
>> }
>>
>> - if (!clp->server_scope)
>> + if (!clp->server_scope) {
>> clp->server_scope = res.server_scope;
>> - else
>> - kfree(res.server_scope);
>> + goto out;
>> + }
>> }
>> -
>> + kfree(res.server_scope);
>> +out:
>> dprintk("<-- %s status= %d\n", __func__, status);
>> return status;
>> }
>
> This looks like it is a bug in existing kernels. Should I queue it up
> for [email protected]?
Yes, I should have mentioned that!
-dros
server_scope would never be freed if nfs4_check_cl_exchange_flags() returned
non-zero
Signed-off-by: Weston Andros Adamson <[email protected]>
---
This should be pushed to [email protected]
fs/nfs/nfs4proc.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 87c584d..20c3bb0 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4945,8 +4945,10 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
clp->cl_rpcclient->cl_auth->au_flavor);
res.server_scope = kzalloc(sizeof(struct server_scope), GFP_KERNEL);
- if (unlikely(!res.server_scope))
- return -ENOMEM;
+ if (unlikely(!res.server_scope)) {
+ status = -ENOMEM;
+ goto out;
+ }
status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT);
if (!status)
@@ -4963,12 +4965,13 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
clp->server_scope = NULL;
}
- if (!clp->server_scope)
+ if (!clp->server_scope) {
clp->server_scope = res.server_scope;
- else
- kfree(res.server_scope);
+ goto out;
+ }
}
-
+ kfree(res.server_scope);
+out:
dprintk("<-- %s status= %d\n", __func__, status);
return status;
}
--
1.7.4.4
T24gVGh1LCAyM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a2xlYnVzdEBuZXRhcHAuY29tDQp3d3cubmV0YXBwLmNv
bQ0KDQo=
Shows the implementation ids in /proc/self/mountstats. This doesn't break
the nfs-utils mountstats tool.
Signed-off-by: Weston Andros Adamson <[email protected]>
---
fs/nfs/client.c | 1 +
fs/nfs/nfs4proc.c | 21 +++++++++++++++++++++
fs/nfs/nfs4xdr.c | 42 +++++++++++++++++++++++++++++++++++++-----
fs/nfs/super.c | 8 ++++++++
include/linux/nfs_fs_sb.h | 2 ++
include/linux/nfs_xdr.h | 15 +++++++--------
6 files changed, 76 insertions(+), 13 deletions(-)
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index d0f850f..3fd9a47 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -302,6 +302,7 @@ static void nfs_free_client(struct nfs_client *clp)
kfree(clp->cl_hostname);
kfree(clp->server_scope);
+ kfree(clp->impl_id);
kfree(clp);
dprintk("<-- nfs_free_client()\n");
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 20c3bb0..90a17cc 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4950,11 +4950,24 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
goto out;
}
+ res.impl_id = kzalloc(sizeof(struct nfs41_impl_id), GFP_KERNEL);
+ if (unlikely(!res.impl_id)) {
+ status = -ENOMEM;
+ goto out_server_scope;
+ }
+
status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT);
if (!status)
status = nfs4_check_cl_exchange_flags(clp->cl_exchange_flags);
if (!status) {
+ /* use the most recent implementation id */
+ kfree(clp->impl_id);
+ clp->impl_id = res.impl_id;
+ } else
+ kfree(res.impl_id);
+
+ if (!status) {
if (clp->server_scope &&
!nfs41_same_server_scope(clp->server_scope,
res.server_scope)) {
@@ -4970,8 +4983,16 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
goto out;
}
}
+
+out_server_scope:
kfree(res.server_scope);
out:
+ if (clp->impl_id)
+ dprintk("%s: Server Implementation ID: "
+ "domain: %s, name: %s, date: %llu,%u\n",
+ __func__, clp->impl_id->domain, clp->impl_id->name,
+ clp->impl_id->date.seconds,
+ clp->impl_id->date.nseconds);
dprintk("<-- %s status= %d\n", __func__, status);
return status;
}
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index d824aed..b7c0433 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -291,7 +291,11 @@ static int nfs4_stat_to_errno(int);
/* eir_server_scope<> */ \
XDR_QUADLEN(NFS4_OPAQUE_LIMIT) + 1 + \
1 /* eir_server_impl_id array length */ + \
- 0 /* ignored eir_server_impl_id contents */)
+ 1 /* nii_domain */ + \
+ XDR_QUADLEN(NFS4_OPAQUE_LIMIT) + \
+ 1 /* nii_name */ + \
+ XDR_QUADLEN(NFS4_OPAQUE_LIMIT) + \
+ 3 /* nii_date */)
#define encode_channel_attrs_maxsz (6 + 1 /* ca_rdma_ird.len (0) */)
#define decode_channel_attrs_maxsz (6 + \
1 /* ca_rdma_ird.len */ + \
@@ -5256,6 +5260,7 @@ static int decode_exchange_id(struct xdr_stream *xdr,
char *dummy_str;
int status;
struct nfs_client *clp = res->client;
+ uint32_t impl_id_count;
status = decode_op_hdr(xdr, OP_EXCHANGE_ID);
if (status)
@@ -5297,11 +5302,38 @@ static int decode_exchange_id(struct xdr_stream *xdr,
memcpy(res->server_scope->server_scope, dummy_str, dummy);
res->server_scope->server_scope_sz = dummy;
- /* Throw away Implementation id array */
- status = decode_opaque_inline(xdr, &dummy, &dummy_str);
- if (unlikely(status))
- return status;
+ /* Implementation Id */
+ p = xdr_inline_decode(xdr, 4);
+ if (unlikely(!p))
+ goto out_overflow;
+ impl_id_count = be32_to_cpup(p++);
+ if (impl_id_count) {
+ /* nii_domain */
+ status = decode_opaque_inline(xdr, &dummy, &dummy_str);
+ if (unlikely(status))
+ return status;
+ if (unlikely(dummy > NFS4_OPAQUE_LIMIT))
+ return -EIO;
+ memcpy(res->impl_id->domain, dummy_str, dummy);
+
+ /* nii_name */
+ status = decode_opaque_inline(xdr, &dummy, &dummy_str);
+ if (unlikely(status))
+ return status;
+ if (unlikely(dummy > NFS4_OPAQUE_LIMIT))
+ return -EIO;
+ memcpy(res->impl_id->name, dummy_str, dummy);
+
+ /* nii_date */
+ p = xdr_inline_decode(xdr, 12);
+ if (unlikely(!p))
+ goto out_overflow;
+ p = xdr_decode_hyper(p, &res->impl_id->date.seconds);
+ res->impl_id->date.nseconds = be32_to_cpup(p);
+
+ /* if there's more than one entry, ignore the rest */
+ }
return 0;
out_overflow:
print_overflow_msg(__func__, xdr);
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index d05024a..5462225 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -809,6 +809,14 @@ static int nfs_show_stats(struct seq_file *m, struct dentry *root)
seq_printf(m, "\n\tage:\t%lu", (jiffies - nfss->mount_time) / HZ);
+ if (nfss->nfs_client && nfss->nfs_client->impl_id) {
+ struct nfs41_impl_id *impl_id = nfss->nfs_client->impl_id;
+ seq_printf(m, "\n\timpl_id:\tname='%s',domain='%s',"
+ "date='%llu,%u'",
+ impl_id->name, impl_id->domain,
+ impl_id->date.seconds, impl_id->date.nseconds);
+ }
+
seq_printf(m, "\n\tcaps:\t");
seq_printf(m, "caps=0x%x", nfss->caps);
seq_printf(m, ",wtmult=%u", nfss->wtmult);
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 3bf4766..03d0b91 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -18,6 +18,7 @@ struct nfs4_sequence_res;
struct nfs_server;
struct nfs4_minor_version_ops;
struct server_scope;
+struct nfs41_impl_id;
/*
* The nfs_client identifies our client state to the server.
@@ -86,6 +87,7 @@ struct nfs_client {
#endif
struct server_scope *server_scope; /* from exchange_id */
+ struct nfs41_impl_id *impl_id; /* from exchange_id */
struct net *net;
};
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index adbc84a..046c1bf 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1054,14 +1054,6 @@ struct nfstime4 {
};
#ifdef CONFIG_NFS_V4_1
-struct nfs_impl_id4 {
- u32 domain_len;
- char *domain;
- u32 name_len;
- char *name;
- struct nfstime4 date;
-};
-
#define NFS4_EXCHANGE_ID_LEN (48)
struct nfs41_exchange_id_args {
struct nfs_client *client;
@@ -1082,10 +1074,17 @@ struct server_scope {
char server_scope[NFS4_OPAQUE_LIMIT];
};
+struct nfs41_impl_id {
+ char domain[NFS4_OPAQUE_LIMIT + 1];
+ char name[NFS4_OPAQUE_LIMIT + 1];
+ struct nfstime4 date;
+};
+
struct nfs41_exchange_id_res {
struct nfs_client *client;
u32 flags;
struct server_scope *server_scope;
+ struct nfs41_impl_id *impl_id;
};
struct nfs41_create_session_args {
--
1.7.4.4
On 03/06/2012 12:08 PM, Adamson, Dros wrote:
>
> On Mar 4, 2012, at 6:33 PM, Myklebust, Trond wrote:
>
>> On Sat, 2012-03-03 at 09:09 -0500, Bryan Schumaker wrote:
>>> Hi Dros,
>>>
>>> On 02/17/2012 03:20 PM, Weston Andros Adamson wrote:
>>>
>>>> Shows the implementation ids in /proc/self/mountstats. This doesn't break
>>>> the nfs-utils mountstats tool.
>>>>
>>>> Signed-off-by: Weston Andros Adamson <[email protected]>
>>>> ---
>>>> fs/nfs/client.c | 1 +
>>>> fs/nfs/nfs4proc.c | 21 +++++++++++++++++++++
>>>> fs/nfs/nfs4xdr.c | 42 +++++++++++++++++++++++++++++++++++++-----
>>>> fs/nfs/super.c | 8 ++++++++
>>>> include/linux/nfs_fs_sb.h | 2 ++
>>>> include/linux/nfs_xdr.h | 15 +++++++--------
>>>> 6 files changed, 76 insertions(+), 13 deletions(-)
>>>>
>>>
>>> <snip>
>>>
>>>> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
>>>> index d05024a..5462225 100644
>>>> --- a/fs/nfs/super.c
>>>> +++ b/fs/nfs/super.c
>>>> @@ -809,6 +809,14 @@ static int nfs_show_stats(struct seq_file *m, struct dentry *root)
>>>>
>>>> seq_printf(m, "\n\tage:\t%lu", (jiffies - nfss->mount_time) / HZ);
>>>>
>>>> + if (nfss->nfs_client && nfss->nfs_client->impl_id) {
>>>> + struct nfs41_impl_id *impl_id = nfss->nfs_client->impl_id;
>>>
>>>
>>> "struct nfs41_impl_id" is only defined when CONFIG_NFS_V4_1 is enabled, so if I compile without NFS 4.1 enabled I get this error:
>>>
>>> CC [M] fs/nfs/super.o
>>> /home/bjschuma/linux/modules/fs/nfs/super.c: In function 'nfs_show_stats':
>>> /home/bjschuma/linux/modules/fs/nfs/super.c:843:14: error: dereferencing pointer to incomplete type
>>> /home/bjschuma/linux/modules/fs/nfs/super.c:843:29: error: dereferencing pointer to incomplete type
>>> /home/bjschuma/linux/modules/fs/nfs/super.c:844:14: error: dereferencing pointer to incomplete type
>>> /home/bjschuma/linux/modules/fs/nfs/super.c:844:37: error: dereferencing pointer to incomplete type
>>> make[3]: *** [fs/nfs/super.o] Error 1
>
> Oops! Good catch Bryan!
>
>>
>> Hi Bryan & Dros
>>
>> I've applied the following patch to fix this issue. Please advise if
>> you're still seeing compile problems when it is applied.
>>
>> 8<----------------------------------------------------------------------------
>> From d032769b833d8fbaaa620a54300979dd5881d493 Mon Sep 17 00:00:00 2001
>> From: Trond Myklebust <[email protected]>
>> Date: Sun, 4 Mar 2012 18:12:57 -0500
>> Subject: [PATCH] NFS: Fix a compile issue when !CONFIG_NFS_V4_1
>>
>> The attempt to display the implementation ID needs to be conditional on
>> whether or not CONFIG_NFS_V4_1 is defined
>>
>> Reported-by: Bryan Schumaker <[email protected]>
>> Signed-off-by: Trond Myklebust <[email protected]>
>> ---
>> fs/nfs/super.c | 22 +++++++++++++++-------
>> 1 files changed, 15 insertions(+), 7 deletions(-)
>>
>> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
>> index 3935a37..61419c9 100644
>> --- a/fs/nfs/super.c
>> +++ b/fs/nfs/super.c
>> @@ -785,8 +785,22 @@ static void show_pnfs(struct seq_file *m, struct nfs_server *server)
>> else
>> seq_printf(m, "not configured");
>> }
>> +
>> +static void show_implementation_id(struct seq_file *m, struct nfs_server *nfss)
>> +{
>> + if (nfss->nfs_client && nfss->nfs_client->impl_id) {
>> + struct nfs41_impl_id *impl_id = nfss->nfs_client->impl_id;
>> + seq_printf(m, "\n\timpl_id:\tname='%s',domain='%s',"
>> + "date='%llu,%u'",
>> + impl_id->name, impl_id->domain,
>> + impl_id->date.seconds, impl_id->date.nseconds);
>> + }
>> +}
>> #else
>> static void show_pnfs(struct seq_file *m, struct nfs_server *server) {}
>> +static void show_implementation_id(struct seq_file *m, struct nfs_server *nfss)
>> +{
>> +}
>> #endif
>> #endif
>>
>> @@ -836,13 +850,7 @@ static int nfs_show_stats(struct seq_file *m, struct dentry *root)
>>
>> seq_printf(m, "\n\tage:\t%lu", (jiffies - nfss->mount_time) / HZ);
>>
>> - if (nfss->nfs_client && nfss->nfs_client->impl_id) {
>> - struct nfs41_impl_id *impl_id = nfss->nfs_client->impl_id;
>> - seq_printf(m, "\n\timpl_id:\tname='%s',domain='%s',"
>> - "date='%llu,%u'",
>> - impl_id->name, impl_id->domain,
>> - impl_id->date.seconds, impl_id->date.nseconds);
>> - }
>> + show_implementation_id(m, nfss);
>>
>> seq_printf(m, "\n\tcaps:\t");
>> seq_printf(m, "caps=0x%x", nfss->caps);
>> --
>> 1.7.7.6
>
> Works for me. I need to test with different CONFIG opts more often!
That's actually how I found this. I set up Jenkins to change all the nfs CONFIG options to make sure I had everything covered for my modules patches. I've added compile testing to my normal nightly tests now, so these issuse should be caught faster.
- Bryan
>
> -dros
T24gVHVlLCAyMDEyLTAzLTA2IGF0IDE3OjA4ICswMDAwLCBBZGFtc29uLCBEcm9zIHdyb3RlOg0K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wgc3RydWN0IGRlbnRyeSAqcm9vdCkNCiANCiAJc2VxX3ByaW50ZihtLCAi
XG5cdGFnZTpcdCVsdSIsIChqaWZmaWVzIC0gbmZzcy0+bW91bnRfdGltZSkgLyBIWik7DQogDQot
CWlmIChuZnNzLT5uZnNfY2xpZW50ICYmIG5mc3MtPm5mc19jbGllbnQtPmltcGxfaWQpIHsNCi0J
CXN0cnVjdCBuZnM0MV9pbXBsX2lkICppbXBsX2lkID0gbmZzcy0+bmZzX2NsaWVudC0+aW1wbF9p
ZDsNCi0JCXNlcV9wcmludGYobSwgIlxuXHRpbXBsX2lkOlx0bmFtZT0nJXMnLGRvbWFpbj0nJXMn
LCINCi0JCQkgICAiZGF0ZT0nJWxsdSwldSciLA0KLQkJCSAgIGltcGxfaWQtPm5hbWUsIGltcGxf
aWQtPmRvbWFpbiwNCi0JCQkgICBpbXBsX2lkLT5kYXRlLnNlY29uZHMsIGltcGxfaWQtPmRhdGUu
bnNlY29uZHMpOw0KLQl9DQorCXNob3dfaW1wbGVtZW50YXRpb25faWQobSwgbmZzcyk7DQogDQog
CXNlcV9wcmludGYobSwgIlxuXHRjYXBzOlx0Iik7DQogCXNlcV9wcmludGYobSwgImNhcHM9MHgl
eCIsIG5mc3MtPmNhcHMpOw0KLS0gDQoxLjcuNy42DQoNCg0KLS0gDQpUcm9uZCBNeWtsZWJ1c3QN
CkxpbnV4IE5GUyBjbGllbnQgbWFpbnRhaW5lcg0KDQpOZXRBcHANClRyb25kLk15a2xlYnVzdEBu
ZXRhcHAuY29tDQp3d3cubmV0YXBwLmNvbQ0KDQo=
Hi Dros,
On 02/17/2012 03:20 PM, Weston Andros Adamson wrote:
> Shows the implementation ids in /proc/self/mountstats. This doesn't break
> the nfs-utils mountstats tool.
>
> Signed-off-by: Weston Andros Adamson <[email protected]>
> ---
> fs/nfs/client.c | 1 +
> fs/nfs/nfs4proc.c | 21 +++++++++++++++++++++
> fs/nfs/nfs4xdr.c | 42 +++++++++++++++++++++++++++++++++++++-----
> fs/nfs/super.c | 8 ++++++++
> include/linux/nfs_fs_sb.h | 2 ++
> include/linux/nfs_xdr.h | 15 +++++++--------
> 6 files changed, 76 insertions(+), 13 deletions(-)
>
<snip>
> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
> index d05024a..5462225 100644
> --- a/fs/nfs/super.c
> +++ b/fs/nfs/super.c
> @@ -809,6 +809,14 @@ static int nfs_show_stats(struct seq_file *m, struct dentry *root)
>
> seq_printf(m, "\n\tage:\t%lu", (jiffies - nfss->mount_time) / HZ);
>
> + if (nfss->nfs_client && nfss->nfs_client->impl_id) {
> + struct nfs41_impl_id *impl_id = nfss->nfs_client->impl_id;
"struct nfs41_impl_id" is only defined when CONFIG_NFS_V4_1 is enabled, so if I compile without NFS 4.1 enabled I get this error:
CC [M] fs/nfs/super.o
/home/bjschuma/linux/modules/fs/nfs/super.c: In function 'nfs_show_stats':
/home/bjschuma/linux/modules/fs/nfs/super.c:843:14: error: dereferencing pointer to incomplete type
/home/bjschuma/linux/modules/fs/nfs/super.c:843:29: error: dereferencing pointer to incomplete type
/home/bjschuma/linux/modules/fs/nfs/super.c:844:14: error: dereferencing pointer to incomplete type
/home/bjschuma/linux/modules/fs/nfs/super.c:844:37: error: dereferencing pointer to incomplete type
make[3]: *** [fs/nfs/super.o] Error 1
- Bryan
> + seq_printf(m, "\n\timpl_id:\tname='%s',domain='%s',"
> + "date='%llu,%u'",
> + impl_id->name, impl_id->domain,
> + impl_id->date.seconds, impl_id->date.nseconds);
> + }
> +
> seq_printf(m, "\n\tcaps:\t");
> seq_printf(m, "caps=0x%x", nfss->caps);
> seq_printf(m, ",wtmult=%u", nfss->wtmult);
On Mar 4, 2012, at 6:33 PM, Myklebust, Trond wrote:
> On Sat, 2012-03-03 at 09:09 -0500, Bryan Schumaker wrote:
>> Hi Dros,
>>
>> On 02/17/2012 03:20 PM, Weston Andros Adamson wrote:
>>
>>> Shows the implementation ids in /proc/self/mountstats. This doesn't break
>>> the nfs-utils mountstats tool.
>>>
>>> Signed-off-by: Weston Andros Adamson <[email protected]>
>>> ---
>>> fs/nfs/client.c | 1 +
>>> fs/nfs/nfs4proc.c | 21 +++++++++++++++++++++
>>> fs/nfs/nfs4xdr.c | 42 +++++++++++++++++++++++++++++++++++++-----
>>> fs/nfs/super.c | 8 ++++++++
>>> include/linux/nfs_fs_sb.h | 2 ++
>>> include/linux/nfs_xdr.h | 15 +++++++--------
>>> 6 files changed, 76 insertions(+), 13 deletions(-)
>>>
>>
>> <snip>
>>
>>> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
>>> index d05024a..5462225 100644
>>> --- a/fs/nfs/super.c
>>> +++ b/fs/nfs/super.c
>>> @@ -809,6 +809,14 @@ static int nfs_show_stats(struct seq_file *m, struct dentry *root)
>>>
>>> seq_printf(m, "\n\tage:\t%lu", (jiffies - nfss->mount_time) / HZ);
>>>
>>> + if (nfss->nfs_client && nfss->nfs_client->impl_id) {
>>> + struct nfs41_impl_id *impl_id = nfss->nfs_client->impl_id;
>>
>>
>> "struct nfs41_impl_id" is only defined when CONFIG_NFS_V4_1 is enabled, so if I compile without NFS 4.1 enabled I get this error:
>>
>> CC [M] fs/nfs/super.o
>> /home/bjschuma/linux/modules/fs/nfs/super.c: In function 'nfs_show_stats':
>> /home/bjschuma/linux/modules/fs/nfs/super.c:843:14: error: dereferencing pointer to incomplete type
>> /home/bjschuma/linux/modules/fs/nfs/super.c:843:29: error: dereferencing pointer to incomplete type
>> /home/bjschuma/linux/modules/fs/nfs/super.c:844:14: error: dereferencing pointer to incomplete type
>> /home/bjschuma/linux/modules/fs/nfs/super.c:844:37: error: dereferencing pointer to incomplete type
>> make[3]: *** [fs/nfs/super.o] Error 1
Oops! Good catch Bryan!
>
> Hi Bryan & Dros
>
> I've applied the following patch to fix this issue. Please advise if
> you're still seeing compile problems when it is applied.
>
> 8<----------------------------------------------------------------------------
> From d032769b833d8fbaaa620a54300979dd5881d493 Mon Sep 17 00:00:00 2001
> From: Trond Myklebust <[email protected]>
> Date: Sun, 4 Mar 2012 18:12:57 -0500
> Subject: [PATCH] NFS: Fix a compile issue when !CONFIG_NFS_V4_1
>
> The attempt to display the implementation ID needs to be conditional on
> whether or not CONFIG_NFS_V4_1 is defined
>
> Reported-by: Bryan Schumaker <[email protected]>
> Signed-off-by: Trond Myklebust <[email protected]>
> ---
> fs/nfs/super.c | 22 +++++++++++++++-------
> 1 files changed, 15 insertions(+), 7 deletions(-)
>
> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
> index 3935a37..61419c9 100644
> --- a/fs/nfs/super.c
> +++ b/fs/nfs/super.c
> @@ -785,8 +785,22 @@ static void show_pnfs(struct seq_file *m, struct nfs_server *server)
> else
> seq_printf(m, "not configured");
> }
> +
> +static void show_implementation_id(struct seq_file *m, struct nfs_server *nfss)
> +{
> + if (nfss->nfs_client && nfss->nfs_client->impl_id) {
> + struct nfs41_impl_id *impl_id = nfss->nfs_client->impl_id;
> + seq_printf(m, "\n\timpl_id:\tname='%s',domain='%s',"
> + "date='%llu,%u'",
> + impl_id->name, impl_id->domain,
> + impl_id->date.seconds, impl_id->date.nseconds);
> + }
> +}
> #else
> static void show_pnfs(struct seq_file *m, struct nfs_server *server) {}
> +static void show_implementation_id(struct seq_file *m, struct nfs_server *nfss)
> +{
> +}
> #endif
> #endif
>
> @@ -836,13 +850,7 @@ static int nfs_show_stats(struct seq_file *m, struct dentry *root)
>
> seq_printf(m, "\n\tage:\t%lu", (jiffies - nfss->mount_time) / HZ);
>
> - if (nfss->nfs_client && nfss->nfs_client->impl_id) {
> - struct nfs41_impl_id *impl_id = nfss->nfs_client->impl_id;
> - seq_printf(m, "\n\timpl_id:\tname='%s',domain='%s',"
> - "date='%llu,%u'",
> - impl_id->name, impl_id->domain,
> - impl_id->date.seconds, impl_id->date.nseconds);
> - }
> + show_implementation_id(m, nfss);
>
> seq_printf(m, "\n\tcaps:\t");
> seq_printf(m, "caps=0x%x", nfss->caps);
> --
> 1.7.7.6
Works for me. I need to test with different CONFIG opts more often!
-dros