* [PATCH] pnfsd: Correctly set netid to tcp or tcp6 for non-local exports
@ 2011-05-31 18:20 Michael Groshans
0 siblings, 0 replies; only message in thread
From: Michael Groshans @ 2011-05-31 18:20 UTC (permalink / raw)
To: linux-nfs
From: Michael Groshans <groshans@umich.edu>
Decide whether or not to send tcp or tcp6 in the netid field of GETDEVICEINFO
replies by checking for the presence of a colon in the address.
Signed-off by: Michael Groshans <groshans@umich.edu>
---
fs/nfsd/nfs4pnfsdlm.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/fs/nfsd/nfs4pnfsdlm.c b/fs/nfsd/nfs4pnfsdlm.c
index 0068ba0..1159cca 100644
--- a/fs/nfsd/nfs4pnfsdlm.c
+++ b/fs/nfsd/nfs4pnfsdlm.c
@@ -319,9 +319,6 @@ static int nfsd4_pnfs_dlm_getdevinfo(struct super_block *sb,
goto out;
}
- daddr->r_netid.data = "tcp";
- daddr->r_netid.len = 3;
-
len = strcspn(bufp, ",");
daddr->r_addr.data = kmalloc(len + 4, GFP_KERNEL);
memcpy(daddr->r_addr.data, bufp, len);
@@ -332,6 +329,14 @@ static int nfsd4_pnfs_dlm_getdevinfo(struct super_block *sb,
memcpy(daddr->r_addr.data + len, ".8.1", 4);
daddr->r_addr.len = len + 4;
+ if (strcspn(daddr->r_addr.data, ":") - 1 == daddr->r_addr.len) {
+ daddr->r_netid.data = "tcp";
+ daddr->r_netid.len = 3;
+ } else {
+ daddr->r_netid.data = "tcp6";
+ daddr->r_netid.len = 4;
+ }
+
fdev.fl_device_list[i].fl_multipath_length = 1;
fdev.fl_device_list[i].fl_multipath_list = daddr;
--
1.7.3.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-05-31 18:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-31 18:20 [PATCH] pnfsd: Correctly set netid to tcp or tcp6 for non-local exports Michael Groshans
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).