public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <steved@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH 2/3] Ensure the corrrect address family is used on RDMA mounts
Date: Tue,  7 Sep 2010 16:22:00 -0400	[thread overview]
Message-ID: <1283890921-3447-3-git-send-email-steved@redhat.com> (raw)
In-Reply-To: <1283890921-3447-1-git-send-email-steved@redhat.com>

Due to the lack of RDMA netid support and no IANA protocol
number defined just make sure the correct address
family is used on RDMA mounts.

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 support/nfs/getport.c |   21 +++++++++++++++++++++
 utils/mount/stropts.c |    4 +++-
 2 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/support/nfs/getport.c b/support/nfs/getport.c
index c930539..8f788d2 100644
--- a/support/nfs/getport.c
+++ b/support/nfs/getport.c
@@ -216,6 +216,17 @@ nfs_get_proto(const char *netid, sa_family_t *family, unsigned long *protocol)
 	struct netconfig *nconf;
 	struct protoent *proto;
 
+	/*
+	 * Special Case for RDMA mounts. Since
+	 * there is no RDMA netid support, just
+	 * ensure the correct address family 
+	 * is used.
+	 */
+	if (strcasecmp(netid, "rdma") == 0) {
+		*family = AF_INET;
+		return 1;
+	}
+
 	nconf = getnetconfigent(netid);
 	if (nconf == NULL)
 		return 0;
@@ -242,6 +253,16 @@ nfs_get_proto(const char *netid, sa_family_t *family, unsigned long *protocol)
 {
 	struct protoent *proto;
 
+	/*
+	 * Special Case for RDMA mounts. Since
+	 * there is not a protocol number define 
+	 * for  RDMA, just ensure the correct 
+	 * address family is used.
+	 */
+	if (strcasecmp(netid, "rdma") == 0) {
+		*family = AF_INET;
+		return 1;
+	}
 	proto = getprotobyname(netid);
 	if (proto == NULL)
 		return 0;
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index eb6ecc5..3f53ade 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -359,7 +359,9 @@ static int nfs_validate_options(struct nfsmount_info *mi)
 	if (!nfs_parse_devname(mi->spec, &mi->hostname, NULL))
 		return 0;
 
-	if (!nfs_nfs_proto_family(mi->options, &family))
+	if (nfs_rdma_option(mi->options))
+		family = AF_INET;
+	else if (!nfs_nfs_proto_family(mi->options, &family))
 		return 0;
 
 	hint.ai_family = (int)family;
-- 
1.7.2.1


  parent reply	other threads:[~2010-09-07 20:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-07 20:21 [PATCH 0/3] mount: Updated RDMA processing in the mount command Steve Dickson
2010-09-07 20:21 ` [PATCH 1/3] Added support for the the -o rdma option Steve Dickson
2010-09-07 20:22 ` Steve Dickson [this message]
2010-09-07 20:22 ` [PATCH 3/3] Document the rdma mount option in the nfs man page Steve Dickson

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=1283890921-3447-3-git-send-email-steved@redhat.com \
    --to=steved@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox