diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2007-12-10 14:57:16 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-01-30 02:05:52 -0500 |
commit | 5d8515caeb99940f5ed56d22a03aba20bbe7fdcb (patch) | |
tree | b17ec1fc7bf34a73f65bf8c4b9f837beb54a64f9 /fs/nfs | |
parent | d4d3c507493afd3c9d19fbe9762f44e790909dbe (diff) |
NFS: eliminate NIPQUAD(clp->cl_addr.sin_addr)
To ensure the NFS client displays IPv6 addresses properly, replace
address family-specific NIPQUAD() invocations with a call to the RPC
client to get a formatted string representing the remote peer's
address.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/client.c | 12 | ||||
-rw-r--r-- | fs/nfs/delegation.c | 10 | ||||
-rw-r--r-- | fs/nfs/nfs4state.c | 9 | ||||
-rw-r--r-- | fs/nfs/super.c | 5 |
4 files changed, 20 insertions, 16 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 3b21731ae571..701cd193a014 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -1279,10 +1279,10 @@ static int nfs_server_list_show(struct seq_file *m, void *v) | |||
1279 | /* display one transport per line on subsequent lines */ | 1279 | /* display one transport per line on subsequent lines */ |
1280 | clp = list_entry(v, struct nfs_client, cl_share_link); | 1280 | clp = list_entry(v, struct nfs_client, cl_share_link); |
1281 | 1281 | ||
1282 | seq_printf(m, "v%u %02x%02x%02x%02x %4hx %3d %s\n", | 1282 | seq_printf(m, "v%u %s %s %3d %s\n", |
1283 | clp->rpc_ops->version, | 1283 | clp->rpc_ops->version, |
1284 | NIPQUAD(clp->cl_addr.sin_addr), | 1284 | rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_HEX_ADDR), |
1285 | ntohs(clp->cl_addr.sin_port), | 1285 | rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_HEX_PORT), |
1286 | atomic_read(&clp->cl_count), | 1286 | atomic_read(&clp->cl_count), |
1287 | clp->cl_hostname); | 1287 | clp->cl_hostname); |
1288 | 1288 | ||
@@ -1358,10 +1358,10 @@ static int nfs_volume_list_show(struct seq_file *m, void *v) | |||
1358 | (unsigned long long) server->fsid.major, | 1358 | (unsigned long long) server->fsid.major, |
1359 | (unsigned long long) server->fsid.minor); | 1359 | (unsigned long long) server->fsid.minor); |
1360 | 1360 | ||
1361 | seq_printf(m, "v%u %02x%02x%02x%02x %4hx %-7s %-17s\n", | 1361 | seq_printf(m, "v%u %s %s %-7s %-17s\n", |
1362 | clp->rpc_ops->version, | 1362 | clp->rpc_ops->version, |
1363 | NIPQUAD(clp->cl_addr.sin_addr), | 1363 | rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_HEX_ADDR), |
1364 | ntohs(clp->cl_addr.sin_port), | 1364 | rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_HEX_PORT), |
1365 | dev, | 1365 | dev, |
1366 | fsid); | 1366 | fsid); |
1367 | 1367 | ||
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index 11833f4caeaa..b03dcd8403f1 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c | |||
@@ -156,8 +156,9 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct | |||
156 | if (memcmp(&delegation->stateid, &nfsi->delegation->stateid, | 156 | if (memcmp(&delegation->stateid, &nfsi->delegation->stateid, |
157 | sizeof(delegation->stateid)) != 0 || | 157 | sizeof(delegation->stateid)) != 0 || |
158 | delegation->type != nfsi->delegation->type) { | 158 | delegation->type != nfsi->delegation->type) { |
159 | printk("%s: server %u.%u.%u.%u, handed out a duplicate delegation!\n", | 159 | printk(KERN_WARNING "%s: server %s handed out " |
160 | __FUNCTION__, NIPQUAD(clp->cl_addr.sin_addr)); | 160 | "a duplicate delegation!\n", |
161 | __FUNCTION__, clp->cl_hostname); | ||
161 | status = -EIO; | 162 | status = -EIO; |
162 | } | 163 | } |
163 | } | 164 | } |
@@ -314,8 +315,9 @@ void nfs_expire_all_delegations(struct nfs_client *clp) | |||
314 | __module_get(THIS_MODULE); | 315 | __module_get(THIS_MODULE); |
315 | atomic_inc(&clp->cl_count); | 316 | atomic_inc(&clp->cl_count); |
316 | task = kthread_run(nfs_do_expire_all_delegations, clp, | 317 | task = kthread_run(nfs_do_expire_all_delegations, clp, |
317 | "%u.%u.%u.%u-delegreturn", | 318 | "%s-delegreturn", |
318 | NIPQUAD(clp->cl_addr.sin_addr)); | 319 | rpc_peeraddr2str(clp->cl_rpcclient, |
320 | RPC_DISPLAY_ADDR)); | ||
319 | if (!IS_ERR(task)) | 321 | if (!IS_ERR(task)) |
320 | return; | 322 | return; |
321 | nfs_put_client(clp); | 323 | nfs_put_client(clp); |
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index bf94c6e0a503..f9c7432471dc 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -758,8 +758,9 @@ static void nfs4_recover_state(struct nfs_client *clp) | |||
758 | 758 | ||
759 | __module_get(THIS_MODULE); | 759 | __module_get(THIS_MODULE); |
760 | atomic_inc(&clp->cl_count); | 760 | atomic_inc(&clp->cl_count); |
761 | task = kthread_run(reclaimer, clp, "%u.%u.%u.%u-reclaim", | 761 | task = kthread_run(reclaimer, clp, "%s-reclaim", |
762 | NIPQUAD(clp->cl_addr.sin_addr)); | 762 | rpc_peeraddr2str(clp->cl_rpcclient, |
763 | RPC_DISPLAY_ADDR)); | ||
763 | if (!IS_ERR(task)) | 764 | if (!IS_ERR(task)) |
764 | return; | 765 | return; |
765 | nfs4_clear_recover_bit(clp); | 766 | nfs4_clear_recover_bit(clp); |
@@ -970,8 +971,8 @@ out: | |||
970 | module_put_and_exit(0); | 971 | module_put_and_exit(0); |
971 | return 0; | 972 | return 0; |
972 | out_error: | 973 | out_error: |
973 | printk(KERN_WARNING "Error: state recovery failed on NFSv4 server %u.%u.%u.%u with error %d\n", | 974 | printk(KERN_WARNING "Error: state recovery failed on NFSv4 server %s" |
974 | NIPQUAD(clp->cl_addr.sin_addr), -status); | 975 | " with error %d\n", clp->cl_hostname, -status); |
975 | set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); | 976 | set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); |
976 | goto out; | 977 | goto out; |
977 | } | 978 | } |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 5608e6a4c1e1..75f3cbf922a3 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -491,8 +491,9 @@ static int nfs_show_options(struct seq_file *m, struct vfsmount *mnt) | |||
491 | 491 | ||
492 | nfs_show_mount_options(m, nfss, 0); | 492 | nfs_show_mount_options(m, nfss, 0); |
493 | 493 | ||
494 | seq_printf(m, ",addr="NIPQUAD_FMT, | 494 | seq_printf(m, ",addr=%s", |
495 | NIPQUAD(nfss->nfs_client->cl_addr.sin_addr)); | 495 | rpc_peeraddr2str(nfss->nfs_client->cl_rpcclient, |
496 | RPC_DISPLAY_ADDR)); | ||
496 | 497 | ||
497 | return 0; | 498 | return 0; |
498 | } | 499 | } |