* [RFC 00/13] Allow NFS to bind to local IP address.
@ 2013-01-21 20:45 greearb
2013-01-21 20:45 ` [RFC 01/13] sunrpc: Don't attempt to bind to AF_UNSPEC address greearb
` (12 more replies)
0 siblings, 13 replies; 14+ messages in thread
From: greearb @ 2013-01-21 20:45 UTC (permalink / raw)
To: linux-nfs; +Cc: Ben Greear
From: Ben Greear <greearb@candelatech.com>
This patch series allows binding the nfs and rpc logic to a specific local
IP address.
Features/Benefits:
* Allow multiple unique mounts to the same server using unique
source IP addresses on client system.
Routing rules can then be created based on the source IP address for
advanced routing of the NFS traffic.
This could allow someone to use two 1G interfaces to access a
server with 10G connectivity and allow aggregate 2Gbps transfer,
for instance.
This is also useful for load testing NFS servers as well as the
client-side NFS logic (note the bugs & fixed found while testing
this code!)
* Allow using a specific IP address on multi-homed system. This could
increase security in some cases and in general gives the user more
control over how the services are configured.
This code has been tested under load on 3.7.3 and similar versions have
been tested for many years on previous kernels.
Full implementation of this feature requires patches to mount.nfs,
which were previously agreed to be accepted if the kernel patches are accepted.
Ben Greear (13):
sunrpc: Don't attempt to bind to AF_UNSPEC address.
nfs: Two AF_UNSPEC addresses should always match each other.
nfs: Add srcaddr member to nfs_client.
nfs: Use request destination addr as callback source addr.
nfs: Pay attention to srcaddr in v4.1 callback logic.
nfs: Use srcaddr in nfs_match_client.
nfs: Pass srcaddr into mount request.
nfs: Propagate src-addr in client code.
nfs: Bind to srcaddr in rpcb_create.
nfs: Support srcaddr= to bind to specific IP address.
nfs: Add srcaddr to /proc/fs/nfsfs/servers
lockd: Support binding nlm client to specific address.
nfs: Allow up to 5000 NFSv4 connections (instead of 1024).
fs/lockd/clntlock.c | 3 +-
fs/lockd/host.c | 17 +++++++++++++++-
fs/nfs/callback.c | 2 +-
fs/nfs/callback.h | 3 ++
fs/nfs/callback_proc.c | 3 +-
fs/nfs/callback_xdr.c | 3 ++
fs/nfs/client.c | 35 ++++++++++++++++++++++++++++++-
fs/nfs/internal.h | 14 +++++++++++-
fs/nfs/mount_clnt.c | 1 +
fs/nfs/nfs4client.c | 32 +++++++++++++++++++++++++++++-
fs/nfs/super.c | 33 +++++++++++++++++++++++++++++-
include/linux/lockd/bind.h | 1 +
include/linux/lockd/lockd.h | 1 +
include/linux/nfs_fs_sb.h | 4 +++
include/linux/sunrpc/clnt.h | 2 +
include/linux/sunrpc/svc.h | 1 +
net/sunrpc/rpcb_clnt.c | 31 ++++++++++++++++++++++++++--
net/sunrpc/sunrpc.h | 45 ++++++++++++++++++++++++++++++++++++++++++
net/sunrpc/xprtsock.c | 46 +-----------------------------------------
19 files changed, 220 insertions(+), 57 deletions(-)
--
1.7.3.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [RFC 01/13] sunrpc: Don't attempt to bind to AF_UNSPEC address.
2013-01-21 20:45 [RFC 00/13] Allow NFS to bind to local IP address greearb
@ 2013-01-21 20:45 ` greearb
2013-01-21 20:45 ` [RFC 02/13] nfs: Two AF_UNSPEC addresses should always match each other greearb
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: greearb @ 2013-01-21 20:45 UTC (permalink / raw)
To: linux-nfs; +Cc: Ben Greear
From: Ben Greear <greearb@candelatech.com>
This lets calling code simply pass AF_UNSPEC addresses
instead of adding lots of checks to conditionally pass
NULL addresses.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
net/sunrpc/xprtsock.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 75853ca..32a016e 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2561,9 +2561,9 @@ static struct rpc_xprt *xs_setup_xprt(struct xprt_create *args,
new = container_of(xprt, struct sock_xprt, xprt);
memcpy(&xprt->addr, args->dstaddr, args->addrlen);
xprt->addrlen = args->addrlen;
- if (args->srcaddr)
+ if (args->srcaddr && (args->srcaddr->sa_family != AF_UNSPEC)) {
memcpy(&new->srcaddr, args->srcaddr, args->addrlen);
- else {
+ } else {
int err;
err = xs_init_anyaddr(args->dstaddr->sa_family,
(struct sockaddr *)&new->srcaddr);
--
1.7.3.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [RFC 02/13] nfs: Two AF_UNSPEC addresses should always match each other.
2013-01-21 20:45 [RFC 00/13] Allow NFS to bind to local IP address greearb
2013-01-21 20:45 ` [RFC 01/13] sunrpc: Don't attempt to bind to AF_UNSPEC address greearb
@ 2013-01-21 20:45 ` greearb
2013-01-21 20:45 ` [RFC 03/13] nfs: Add srcaddr member to nfs_client greearb
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: greearb @ 2013-01-21 20:45 UTC (permalink / raw)
To: linux-nfs; +Cc: Ben Greear
From: Ben Greear <greearb@candelatech.com>
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
fs/nfs/client.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 5e8d24d..809fd1e 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -369,6 +369,8 @@ int nfs_sockaddr_match_ipaddr(const struct sockaddr *sa1,
return nfs_sockaddr_match_ipaddr4(sa1, sa2);
case AF_INET6:
return nfs_sockaddr_match_ipaddr6(sa1, sa2);
+ case AF_UNSPEC:
+ return 1; /* two UNSPEC addresses match */
}
return 0;
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [RFC 03/13] nfs: Add srcaddr member to nfs_client.
2013-01-21 20:45 [RFC 00/13] Allow NFS to bind to local IP address greearb
2013-01-21 20:45 ` [RFC 01/13] sunrpc: Don't attempt to bind to AF_UNSPEC address greearb
2013-01-21 20:45 ` [RFC 02/13] nfs: Two AF_UNSPEC addresses should always match each other greearb
@ 2013-01-21 20:45 ` greearb
2013-01-21 20:45 ` [RFC 04/13] nfs: Use request destination addr as callback source addr greearb
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: greearb @ 2013-01-21 20:45 UTC (permalink / raw)
To: linux-nfs; +Cc: Ben Greear
From: Ben Greear <greearb@candelatech.com>
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
fs/nfs/internal.h | 5 +++++
fs/nfs/super.c | 2 ++
include/linux/nfs_fs_sb.h | 4 ++++
3 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 05521ca..80504e1 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -119,6 +119,11 @@ struct nfs_parsed_mount_data {
struct {
struct sockaddr_storage address;
size_t addrlen;
+ } srcaddr;
+
+ struct {
+ struct sockaddr_storage address;
+ size_t addrlen;
char *hostname;
u32 version;
int port;
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 00be08f..61b3dc9 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -968,6 +968,8 @@ static struct nfs_parsed_mount_data *nfs_alloc_parsed_mount_data(void)
data->minorversion = 0;
data->need_mount = true;
data->net = current->nsproxy->net_ns;
+ data->srcaddr.address.ss_family = AF_UNSPEC;
+ data->srcaddr.addrlen = sizeof(data->srcaddr.address);
security_init_mnt_opts(&data->lsm_opts);
}
return data;
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index a9e76ee..0f5d16d 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -88,6 +88,10 @@ struct nfs_client {
struct nfs41_impl_id *cl_implid;
#endif /* CONFIG_NFS_V4 */
+ /* If we should bind to a local IP, it should be specified below. */
+ struct sockaddr_storage srcaddr;
+ size_t srcaddrlen;
+
#ifdef CONFIG_NFS_FSCACHE
struct fscache_cookie *fscache; /* client index cache cookie */
#endif
--
1.7.3.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [RFC 04/13] nfs: Use request destination addr as callback source addr.
2013-01-21 20:45 [RFC 00/13] Allow NFS to bind to local IP address greearb
` (2 preceding siblings ...)
2013-01-21 20:45 ` [RFC 03/13] nfs: Add srcaddr member to nfs_client greearb
@ 2013-01-21 20:45 ` greearb
2013-01-21 20:45 ` [RFC 05/13] nfs: Pay attention to srcaddr in v4.1 callback logic greearb
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: greearb @ 2013-01-21 20:45 UTC (permalink / raw)
To: linux-nfs; +Cc: Ben Greear
From: Ben Greear <greearb@candelatech.com>
This helps make sure that responses use the correct
source address on multi-homed machines.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
fs/nfs/callback.h | 3 +++
fs/nfs/callback_xdr.c | 3 +++
include/linux/sunrpc/svc.h | 1 +
3 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/fs/nfs/callback.h b/fs/nfs/callback.h
index 4251c2a..1a695f7 100644
--- a/fs/nfs/callback.h
+++ b/fs/nfs/callback.h
@@ -59,6 +59,7 @@ struct cb_compound_hdr_res {
struct cb_getattrargs {
struct sockaddr *addr;
+ struct sockaddr *srcaddr;
struct nfs_fh fh;
uint32_t bitmap[2];
};
@@ -74,6 +75,7 @@ struct cb_getattrres {
struct cb_recallargs {
struct sockaddr *addr;
+ struct sockaddr *srcaddr;
struct nfs_fh fh;
nfs4_stateid stateid;
uint32_t truncate;
@@ -94,6 +96,7 @@ struct referring_call_list {
struct cb_sequenceargs {
struct sockaddr *csa_addr;
+ struct sockaddr *csa_daddr;
struct nfs4_sessionid csa_sessionid;
uint32_t csa_sequenceid;
uint32_t csa_slotid;
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index 742ff4f..75cff02 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -198,6 +198,7 @@ static __be32 decode_getattr_args(struct svc_rqst *rqstp, struct xdr_stream *xdr
if (unlikely(status != 0))
goto out;
args->addr = svc_addr(rqstp);
+ args->srcaddr = svc_daddr(rqstp);
status = decode_bitmap(xdr, args->bitmap);
out:
dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
@@ -210,6 +211,7 @@ static __be32 decode_recall_args(struct svc_rqst *rqstp, struct xdr_stream *xdr,
__be32 status;
args->addr = svc_addr(rqstp);
+ args->srcaddr = svc_daddr(rqstp);
status = decode_stateid(xdr, &args->stateid);
if (unlikely(status != 0))
goto out;
@@ -448,6 +450,7 @@ static __be32 decode_cb_sequence_args(struct svc_rqst *rqstp,
goto out;
args->csa_addr = svc_addr(rqstp);
+ args->csa_daddr = svc_daddr(rqstp);
args->csa_sequenceid = ntohl(*p++);
args->csa_slotid = ntohl(*p++);
args->csa_highestslotid = ntohl(*p++);
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index d83db80..bf134c3 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -313,6 +313,7 @@ static inline struct sockaddr *svc_daddr(const struct svc_rqst *rqst)
return (struct sockaddr *) &rqst->rq_daddr;
}
+
/*
* Check buffer bounds after decoding arguments
*/
--
1.7.3.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [RFC 05/13] nfs: Pay attention to srcaddr in v4.1 callback logic.
2013-01-21 20:45 [RFC 00/13] Allow NFS to bind to local IP address greearb
` (3 preceding siblings ...)
2013-01-21 20:45 ` [RFC 04/13] nfs: Use request destination addr as callback source addr greearb
@ 2013-01-21 20:45 ` greearb
2013-01-21 20:45 ` [RFC 06/13] nfs: Use srcaddr in nfs_match_client greearb
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: greearb @ 2013-01-21 20:45 UTC (permalink / raw)
To: linux-nfs; +Cc: Ben Greear
From: Ben Greear <greearb@candelatech.com>
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
fs/nfs/callback_proc.c | 3 ++-
fs/nfs/internal.h | 6 ++++--
fs/nfs/nfs4client.c | 24 +++++++++++++++++++++++-
3 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index 36b2e7a..24a3457 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -451,7 +451,8 @@ __be32 nfs4_callback_sequence(struct cb_sequenceargs *args,
int i;
__be32 status = htonl(NFS4ERR_BADSESSION);
- clp = nfs4_find_client_sessionid(cps->net, args->csa_addr, &args->csa_sessionid);
+ clp = nfs4_find_client_sessionid(cps->net, args->csa_daddr, args->csa_addr,
+ &args->csa_sessionid);
if (clp == NULL)
goto out;
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 80504e1..11c5ac7 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -190,8 +190,10 @@ extern void nfs_put_client(struct nfs_client *);
extern void nfs_free_client(struct nfs_client *);
extern struct nfs_client *nfs4_find_client_ident(struct net *, int);
extern struct nfs_client *
-nfs4_find_client_sessionid(struct net *, const struct sockaddr *,
- struct nfs4_sessionid *);
+nfs4_find_client_sessionid(struct net *,
+ const struct sockaddr *srcaddr,
+ const struct sockaddr *addr,
+ struct nfs4_sessionid *);
extern struct nfs_server *nfs_create_server(struct nfs_mount_info *,
struct nfs_subversion *);
extern struct nfs_server *nfs4_create_server(
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 1f55131..7c4dc21 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -543,11 +543,13 @@ static bool nfs4_cb_match_client(const struct sockaddr *addr,
* Returns NULL if no such client
*/
struct nfs_client *
-nfs4_find_client_sessionid(struct net *net, const struct sockaddr *addr,
+nfs4_find_client_sessionid(struct net *net, const struct sockaddr *srcaddr,
+ const struct sockaddr *addr,
struct nfs4_sessionid *sid)
{
struct nfs_client *clp;
struct nfs_net *nn = net_generic(net, nfs_net_id);
+ struct nfs_client *ok_fit = NULL;
spin_lock(&nn->nfs_client_lock);
list_for_each_entry(clp, &nn->nfs_client_list, cl_share_link) {
@@ -562,10 +564,30 @@ nfs4_find_client_sessionid(struct net *net, const struct sockaddr *addr,
sid->data, NFS4_MAX_SESSIONID_LEN) != 0)
continue;
+ if (srcaddr) {
+ const struct sockaddr *sa;
+ sa = (const struct sockaddr *)&clp->cl_addr;
+ if (!nfs_sockaddr_match_ipaddr(srcaddr, sa)) {
+ /* If clp doesn't bind to srcaddr, then
+ * it is a potential match if we don't find
+ * a better one.
+ */
+ if (sa->sa_family == AF_UNSPEC && !ok_fit)
+ ok_fit = clp;
+ continue;
+ }
+ }
+found_one:
atomic_inc(&clp->cl_count);
spin_unlock(&nn->nfs_client_lock);
return clp;
}
+
+ if (ok_fit) {
+ clp = ok_fit;
+ goto found_one;
+ }
+
spin_unlock(&nn->nfs_client_lock);
return NULL;
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [RFC 06/13] nfs: Use srcaddr in nfs_match_client.
2013-01-21 20:45 [RFC 00/13] Allow NFS to bind to local IP address greearb
` (4 preceding siblings ...)
2013-01-21 20:45 ` [RFC 05/13] nfs: Pay attention to srcaddr in v4.1 callback logic greearb
@ 2013-01-21 20:45 ` greearb
2013-01-21 20:45 ` [RFC 07/13] nfs: Pass srcaddr into mount request greearb
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: greearb @ 2013-01-21 20:45 UTC (permalink / raw)
To: linux-nfs; +Cc: Ben Greear
From: Ben Greear <greearb@candelatech.com>
For bound clients, we have to make sure we do not re-use
a client that is bound differently.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
fs/nfs/client.c | 10 ++++++++++
fs/nfs/internal.h | 2 ++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 809fd1e..e5230fe 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -408,6 +408,9 @@ static struct nfs_client *nfs_match_client(const struct nfs_client_initdata *dat
list_for_each_entry(clp, &nn->nfs_client_list, cl_share_link) {
const struct sockaddr *clap = (struct sockaddr *)&clp->cl_addr;
+ const struct sockaddr *sa;
+ sa = (const struct sockaddr *)&clp->srcaddr;
+
/* Don't match clients that failed to initialise properly */
if (clp->cl_cons_state < 0)
continue;
@@ -425,6 +428,13 @@ static struct nfs_client *nfs_match_client(const struct nfs_client_initdata *dat
if (!nfs_sockaddr_cmp(sap, clap))
continue;
+ /* Check to make sure local-IP bindings match,
+ * but just the IP-addr.
+ */
+ if (data->srcaddr &&
+ !nfs_sockaddr_match_ipaddr(data->srcaddr, sa))
+ continue;
+
atomic_inc(&clp->cl_count);
return clp;
}
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 11c5ac7..dbb2ee7 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -89,7 +89,9 @@ struct nfs_client_initdata {
unsigned long init_flags;
const char *hostname;
const struct sockaddr *addr;
+ const struct sockaddr *srcaddr;
size_t addrlen;
+ size_t srcaddrlen;
struct nfs_subversion *nfs_mod;
int proto;
u32 minorversion;
--
1.7.3.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [RFC 07/13] nfs: Pass srcaddr into mount request.
2013-01-21 20:45 [RFC 00/13] Allow NFS to bind to local IP address greearb
` (5 preceding siblings ...)
2013-01-21 20:45 ` [RFC 06/13] nfs: Use srcaddr in nfs_match_client greearb
@ 2013-01-21 20:45 ` greearb
2013-01-21 20:45 ` [RFC 08/13] nfs: Propagate src-addr in client code greearb
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: greearb @ 2013-01-21 20:45 UTC (permalink / raw)
To: linux-nfs; +Cc: Ben Greear
From: Ben Greear <greearb@candelatech.com>
This starts tying the srcaddr logic together.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
fs/nfs/internal.h | 1 +
fs/nfs/mount_clnt.c | 1 +
fs/nfs/super.c | 2 ++
3 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index dbb2ee7..f4584b7 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -148,6 +148,7 @@ struct nfs_parsed_mount_data {
/* mount_clnt.c */
struct nfs_mount_request {
struct sockaddr *sap;
+ struct sockaddr *srcaddr;
size_t salen;
char *hostname;
char *dirpath;
diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c
index 015f71f..e574f3f 100644
--- a/fs/nfs/mount_clnt.c
+++ b/fs/nfs/mount_clnt.c
@@ -155,6 +155,7 @@ int nfs_mount(struct nfs_mount_request *info)
struct rpc_create_args args = {
.net = info->net,
.protocol = info->protocol,
+ .saddress = info->srcaddr,
.address = info->sap,
.addrsize = info->salen,
.servername = info->hostname,
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 61b3dc9..57f0da3 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1710,6 +1710,8 @@ static int nfs_request_mount(struct nfs_parsed_mount_data *args,
struct nfs_mount_request request = {
.sap = (struct sockaddr *)
&args->mount_server.address,
+ .salen = args->mount_server.addrlen,
+ .srcaddr = (struct sockaddr *)&args->srcaddr.address,
.dirpath = args->nfs_server.export_path,
.protocol = args->mount_server.protocol,
.fh = root_fh,
--
1.7.3.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [RFC 08/13] nfs: Propagate src-addr in client code.
2013-01-21 20:45 [RFC 00/13] Allow NFS to bind to local IP address greearb
` (6 preceding siblings ...)
2013-01-21 20:45 ` [RFC 07/13] nfs: Pass srcaddr into mount request greearb
@ 2013-01-21 20:45 ` greearb
2013-01-21 20:45 ` [RFC 09/13] nfs: Bind to srcaddr in rpcb_create greearb
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: greearb @ 2013-01-21 20:45 UTC (permalink / raw)
To: linux-nfs; +Cc: Ben Greear
From: Ben Greear <greearb@candelatech.com>
This ties the srcaddr supplied by mount to the
rpc code.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
fs/nfs/client.c | 5 +++++
fs/nfs/nfs4client.c | 8 ++++++++
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index e5230fe..bb0a8ce 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -167,6 +167,8 @@ struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_init)
memcpy(&clp->cl_addr, cl_init->addr, cl_init->addrlen);
clp->cl_addrlen = cl_init->addrlen;
+ memcpy(&clp->srcaddr, cl_init->srcaddr, cl_init->srcaddrlen);
+ clp->srcaddrlen = cl_init->srcaddrlen;
if (cl_init->hostname) {
err = -ENOMEM;
@@ -594,6 +596,7 @@ int nfs_create_rpc_client(struct nfs_client *clp,
.net = clp->cl_net,
.protocol = clp->cl_proto,
.address = (struct sockaddr *)&clp->cl_addr,
+ .saddress = (struct sockaddr *)&clp->srcaddr,
.addrsize = clp->cl_addrlen,
.timeout = timeparms,
.servername = clp->cl_hostname,
@@ -751,6 +754,8 @@ static int nfs_init_server(struct nfs_server *server,
.addr = (const struct sockaddr *)&data->nfs_server.address,
.addrlen = data->nfs_server.addrlen,
.nfs_mod = nfs_mod,
+ .srcaddr = (const struct sockaddr *)&data->srcaddr.address,
+ .srcaddrlen = data->srcaddr.addrlen,
.proto = data->nfs_server.protocol,
.net = data->net,
};
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 7c4dc21..bdd5f3b 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -610,6 +610,8 @@ static int nfs4_set_client(struct nfs_server *server,
const struct sockaddr *addr,
const size_t addrlen,
const char *ip_addr,
+ const struct sockaddr *srcaddr,
+ const size_t srcaddrlen,
rpc_authflavor_t authflavour,
int proto, const struct rpc_timeout *timeparms,
u32 minorversion, struct net *net)
@@ -622,6 +624,8 @@ static int nfs4_set_client(struct nfs_server *server,
.proto = proto,
.minorversion = minorversion,
.net = net,
+ .srcaddr = srcaddr,
+ .srcaddrlen = srcaddrlen,
};
struct nfs_client *clp;
int error;
@@ -796,6 +800,8 @@ static int nfs4_init_server(struct nfs_server *server,
(const struct sockaddr *)&data->nfs_server.address,
data->nfs_server.addrlen,
data->client_address,
+ (const struct sockaddr *)&data->srcaddr.address,
+ data->srcaddr.addrlen,
data->auth_flavors[0],
data->nfs_server.protocol,
&timeparms,
@@ -896,6 +902,8 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data,
data->addr,
data->addrlen,
parent_client->cl_ipaddr,
+ (const struct sockaddr *)&parent_client->srcaddr,
+ parent_client->srcaddrlen,
data->authflavor,
rpc_protocol(parent_server->client),
parent_server->client->cl_timeout,
--
1.7.3.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [RFC 09/13] nfs: Bind to srcaddr in rpcb_create.
2013-01-21 20:45 [RFC 00/13] Allow NFS to bind to local IP address greearb
` (7 preceding siblings ...)
2013-01-21 20:45 ` [RFC 08/13] nfs: Propagate src-addr in client code greearb
@ 2013-01-21 20:45 ` greearb
2013-01-21 20:45 ` [RFC 10/13] nfs: Support srcaddr= to bind to specific IP address greearb
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: greearb @ 2013-01-21 20:45 UTC (permalink / raw)
To: linux-nfs; +Cc: Ben Greear
From: Ben Greear <greearb@candelatech.com>
This more properly clones the existing client connection
settings, allowing rpc calls to take advantage of routing
rules based on source IP addresses.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
net/sunrpc/rpcb_clnt.c | 31 ++++++++++++++++++++++++++++---
net/sunrpc/sunrpc.h | 45 +++++++++++++++++++++++++++++++++++++++++++++
net/sunrpc/xprtsock.c | 42 ------------------------------------------
3 files changed, 73 insertions(+), 45 deletions(-)
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
index a70acae..462ee2a 100644
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -31,6 +31,7 @@
#include <linux/sunrpc/xprtsock.h>
#include "netns.h"
+#include "sunrpc.h"
#ifdef RPC_DEBUG
# define RPCDBG_FACILITY RPCDBG_BIND
@@ -346,12 +347,14 @@ out:
}
static struct rpc_clnt *rpcb_create(struct net *net, const char *hostname,
- struct sockaddr *srvaddr, size_t salen,
- int proto, u32 version)
+ struct sockaddr *srvaddr,
+ size_t salen, int proto, u32 version,
+ struct sockaddr *srcaddr)
{
struct rpc_create_args args = {
.net = net,
.protocol = proto,
+ .saddress = srcaddr,
.address = srvaddr,
.addrsize = salen,
.servername = hostname,
@@ -655,16 +658,38 @@ void rpcb_getport_async(struct rpc_task *task)
struct rpc_task *child;
struct sockaddr_storage addr;
struct sockaddr *sap = (struct sockaddr *)&addr;
+ struct sockaddr_storage srcaddr;
+ struct sockaddr *srcaddra = NULL;
size_t salen;
int status;
+ struct sock_xprt *sxprt;
rcu_read_lock();
do {
clnt = rpcb_find_transport_owner(task->tk_client);
xprt = xprt_get(rcu_dereference(clnt->cl_xprt));
} while (xprt == NULL);
+
+ sxprt = container_of(xprt, struct sock_xprt, xprt);
rcu_read_unlock();
+ /* We just want to bind to the IP, not the port */
+ memset(&srcaddr, 0, sizeof(srcaddr));
+ srcaddr.ss_family = sxprt->srcaddr.ss_family;
+ if (sxprt->srcaddr.ss_family == AF_INET) {
+ struct sockaddr_in *si = (struct sockaddr_in *)(&srcaddr);
+ struct sockaddr_in *si2;
+ si2 = (struct sockaddr_in *)(&sxprt->srcaddr);
+ si->sin_addr.s_addr = si2->sin_addr.s_addr;
+ srcaddra = (struct sockaddr *)(&srcaddr);
+ } else if (sxprt->srcaddr.ss_family == AF_INET6) {
+ struct sockaddr_in6 *si = (struct sockaddr_in6 *)(&srcaddr);
+ struct sockaddr_in6 *si2;
+ si2 = (struct sockaddr_in6 *)(&sxprt->srcaddr);
+ memcpy(&si->sin6_addr, &si2->sin6_addr, sizeof(si2->sin6_addr));
+ srcaddra = (struct sockaddr *)(&srcaddr);
+ }
+
dprintk("RPC: %5u %s(%s, %u, %u, %d)\n",
task->tk_pid, __func__,
xprt->servername, clnt->cl_prog, clnt->cl_vers, xprt->prot);
@@ -719,7 +744,7 @@ void rpcb_getport_async(struct rpc_task *task)
task->tk_pid, __func__, bind_version);
rpcb_clnt = rpcb_create(xprt->xprt_net, xprt->servername, sap, salen,
- xprt->prot, bind_version);
+ xprt->prot, bind_version, srcaddra);
if (IS_ERR(rpcb_clnt)) {
status = PTR_ERR(rpcb_clnt);
dprintk("RPC: %5u %s: rpcb_create failed, error %ld\n",
diff --git a/net/sunrpc/sunrpc.h b/net/sunrpc/sunrpc.h
index 14c9f6d..08f2ec5 100644
--- a/net/sunrpc/sunrpc.h
+++ b/net/sunrpc/sunrpc.h
@@ -37,6 +37,51 @@ struct rpc_buffer {
char data[];
};
+struct sock_xprt {
+ struct rpc_xprt xprt;
+
+ /*
+ * Network layer
+ */
+ struct socket *sock;
+ struct sock *inet;
+
+ /*
+ * State of TCP reply receive
+ */
+ __be32 tcp_fraghdr,
+ tcp_xid,
+ tcp_calldir;
+
+ u32 tcp_offset,
+ tcp_reclen;
+
+ unsigned long tcp_copied,
+ tcp_flags;
+
+ /*
+ * Connection of transports
+ */
+ struct delayed_work connect_worker;
+ struct sockaddr_storage srcaddr;
+ unsigned short srcport;
+
+ /*
+ * UDP socket buffer size parameters
+ */
+ size_t rcvsize,
+ sndsize;
+
+ /*
+ * Saved socket callback addresses
+ */
+ void (*old_data_ready)(struct sock *, int);
+ void (*old_state_change)(struct sock *);
+ void (*old_write_space)(struct sock *);
+ void (*old_error_report)(struct sock *);
+};
+
+
static inline int rpc_reply_expected(struct rpc_task *task)
{
return (task->tk_msg.rpc_proc != NULL) &&
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 32a016e..9cb9f16 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -213,48 +213,6 @@ static inline void xs_pktdump(char *msg, u32 *packet, unsigned int count)
}
#endif
-struct sock_xprt {
- struct rpc_xprt xprt;
-
- /*
- * Network layer
- */
- struct socket * sock;
- struct sock * inet;
-
- /*
- * State of TCP reply receive
- */
- __be32 tcp_fraghdr,
- tcp_xid,
- tcp_calldir;
-
- u32 tcp_offset,
- tcp_reclen;
-
- unsigned long tcp_copied,
- tcp_flags;
-
- /*
- * Connection of transports
- */
- struct delayed_work connect_worker;
- struct sockaddr_storage srcaddr;
- unsigned short srcport;
-
- /*
- * UDP socket buffer size parameters
- */
- size_t rcvsize,
- sndsize;
-
- /*
- * Saved socket callback addresses
- */
- void (*old_data_ready)(struct sock *, int);
- void (*old_state_change)(struct sock *);
- void (*old_write_space)(struct sock *);
-};
/*
* TCP receive state flags
--
1.7.3.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [RFC 10/13] nfs: Support srcaddr= to bind to specific IP address.
2013-01-21 20:45 [RFC 00/13] Allow NFS to bind to local IP address greearb
` (8 preceding siblings ...)
2013-01-21 20:45 ` [RFC 09/13] nfs: Bind to srcaddr in rpcb_create greearb
@ 2013-01-21 20:45 ` greearb
2013-01-21 20:45 ` [RFC 11/13] nfs: Add srcaddr to /proc/fs/nfsfs/servers greearb
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: greearb @ 2013-01-21 20:45 UTC (permalink / raw)
To: linux-nfs; +Cc: Ben Greear
From: Ben Greear <greearb@candelatech.com>
In order to have more control on multi-homed machines, it is
nice to be able to bind to a specific IP address. This can aid
with interface selection, policy based routing, multiple unique
mounts to the same server, and similar things.
This patch allows srcaddr= option for NFS. The key 'srcaddr'
was chosen to match the similar patch for cifs.
For NFSv4, if one is specifying clientaddr, it must be the same as
srcaddr or things may not work properly.
NFSv3, NFSv4 over TCP/IPv4 and TCP/IPv6 has been successfully tested.
Usage:
mount -t nfs4 [2002::1]:/rpool/ben /mnt/foo/ben-1 -o srcaddr=2002::2,clientaddr=2002::2
mount -t nfs4 192.168.100.3:/foo /mnt/foo/ben-2 -o srcaddr=192.168.100.174
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
fs/nfs/super.c | 29 ++++++++++++++++++++++++++++-
1 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 57f0da3..cf3d207 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -106,7 +106,7 @@ enum {
/* Mount options that take string arguments */
Opt_nfsvers,
Opt_sec, Opt_proto, Opt_mountproto, Opt_mounthost,
- Opt_addr, Opt_mountaddr, Opt_clientaddr,
+ Opt_addr, Opt_mountaddr, Opt_clientaddr, Opt_srcaddr,
Opt_lookupcache,
Opt_fscache_uniq,
Opt_local_lock,
@@ -176,6 +176,7 @@ static const match_table_t nfs_mount_option_tokens = {
{ Opt_mountproto, "mountproto=%s" },
{ Opt_addr, "addr=%s" },
{ Opt_clientaddr, "clientaddr=%s" },
+ { Opt_srcaddr, "srcaddr=%s" },
{ Opt_mounthost, "mounthost=%s" },
{ Opt_mountaddr, "mountaddr=%s" },
@@ -725,6 +726,15 @@ static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss,
else
nfs_show_nfsv4_options(m, nfss, showdefaults);
+ if (clp->srcaddr.ss_family == AF_INET6) {
+ struct sockaddr_in6 *sin6;
+ sin6 = (struct sockaddr_in6 *)(&clp->srcaddr);
+ seq_printf(m, ",srcaddr=%pI6c", &sin6->sin6_addr);
+ } else if (clp->srcaddr.ss_family == AF_INET) {
+ struct sockaddr_in *sin = (struct sockaddr_in *)&clp->srcaddr;
+ seq_printf(m, ",srcaddr=%pI4", &sin->sin_addr.s_addr);
+ }
+
if (nfss->options & NFS_OPTION_FSCACHE)
seq_printf(m, ",fsc");
@@ -1543,6 +1553,23 @@ static int nfs_parse_mount_options(char *raw,
goto out_nomem;
mnt->options |= NFS_OPTION_FSCACHE;
break;
+ case Opt_srcaddr:
+ string = match_strdup(args);
+ if (string == NULL)
+ goto out_nomem;
+ mnt->srcaddr.addrlen =
+ rpc_pton(mnt->net, string, strlen(string),
+ (struct sockaddr *)
+ &mnt->srcaddr.address,
+ sizeof(mnt->srcaddr.address));
+ kfree(string);
+ if (mnt->srcaddr.addrlen == 0) {
+ printk(KERN_WARNING
+ "nfs: Could not parse srcaddr: %s\n",
+ string);
+ goto out_invalid_address;
+ }
+ break;
case Opt_local_lock:
string = match_strdup(args);
if (string == NULL)
--
1.7.3.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [RFC 11/13] nfs: Add srcaddr to /proc/fs/nfsfs/servers
2013-01-21 20:45 [RFC 00/13] Allow NFS to bind to local IP address greearb
` (9 preceding siblings ...)
2013-01-21 20:45 ` [RFC 10/13] nfs: Support srcaddr= to bind to specific IP address greearb
@ 2013-01-21 20:45 ` greearb
2013-01-21 20:45 ` [RFC 12/13] lockd: Support binding nlm client to specific address greearb
2013-01-21 20:45 ` [RFC 13/13] nfs: Allow up to 5000 NFSv4 connections (instead of 1024) greearb
12 siblings, 0 replies; 14+ messages in thread
From: greearb @ 2013-01-21 20:45 UTC (permalink / raw)
To: linux-nfs; +Cc: Ben Greear
From: Ben Greear <greearb@candelatech.com>
Helps users understand whether a server instance is
bound to a local IP or not.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
fs/nfs/client.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index bb0a8ce..43b6205 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -1311,7 +1311,7 @@ static int nfs_server_list_show(struct seq_file *m, void *v)
/* display header on line 1 */
if (v == &nn->nfs_client_list) {
- seq_puts(m, "NV SERVER PORT USE HOSTNAME\n");
+ seq_puts(m, "NV SERVER PORT USE HOSTNAME SRCADDR\n");
return 0;
}
@@ -1323,7 +1323,7 @@ static int nfs_server_list_show(struct seq_file *m, void *v)
return 0;
rcu_read_lock();
- seq_printf(m, "v%u %s %s %3d %s\n",
+ seq_printf(m, "v%u %s %s %3d %s",
clp->rpc_ops->version,
rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_HEX_ADDR),
rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_HEX_PORT),
@@ -1331,6 +1331,19 @@ static int nfs_server_list_show(struct seq_file *m, void *v)
clp->cl_hostname);
rcu_read_unlock();
+ if (clp->srcaddr.ss_family == AF_INET) {
+ const struct sockaddr_in *sin;
+ sin = (const struct sockaddr_in *)&clp->srcaddr;
+ seq_printf(m, " %pI4\n", &sin->sin_addr.s_addr);
+ } else if (clp->srcaddr.ss_family == AF_INET6) {
+ const struct sockaddr_in6 *sin6;
+ sin6 = (const struct sockaddr_in6 *)&clp->srcaddr;
+ seq_printf(m, " %pI6c\n", &sin6->sin6_addr);
+ } else if (clp->srcaddr.ss_family == AF_UNSPEC)
+ seq_printf(m, " ANY\n");
+ else
+ seq_printf(m, " UNKNOWN_%i\n", (int)(clp->srcaddr.ss_family));
+
return 0;
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [RFC 12/13] lockd: Support binding nlm client to specific address.
2013-01-21 20:45 [RFC 00/13] Allow NFS to bind to local IP address greearb
` (10 preceding siblings ...)
2013-01-21 20:45 ` [RFC 11/13] nfs: Add srcaddr to /proc/fs/nfsfs/servers greearb
@ 2013-01-21 20:45 ` greearb
2013-01-21 20:45 ` [RFC 13/13] nfs: Allow up to 5000 NFSv4 connections (instead of 1024) greearb
12 siblings, 0 replies; 14+ messages in thread
From: greearb @ 2013-01-21 20:45 UTC (permalink / raw)
To: linux-nfs; +Cc: Ben Greear
From: Ben Greear <greearb@candelatech.com>
This ensures that file locking messages use the proper
source IP address if the file system has been mounted
with a specified source IP address.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
fs/lockd/clntlock.c | 3 ++-
fs/lockd/host.c | 17 ++++++++++++++++-
fs/nfs/client.c | 1 +
include/linux/lockd/bind.h | 1 +
include/linux/lockd/lockd.h | 1 +
include/linux/sunrpc/clnt.h | 2 ++
6 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c
index ca0a080..0c21b41 100644
--- a/fs/lockd/clntlock.c
+++ b/fs/lockd/clntlock.c
@@ -60,7 +60,8 @@ struct nlm_host *nlmclnt_init(const struct nlmclnt_initdata *nlm_init)
if (status < 0)
return ERR_PTR(status);
- host = nlmclnt_lookup_host(nlm_init->address, nlm_init->addrlen,
+ host = nlmclnt_lookup_host(nlm_init->address, nlm_init->srcaddr,
+ nlm_init->addrlen,
nlm_init->protocol, nlm_version,
nlm_init->hostname, nlm_init->noresvport,
nlm_init->net);
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index f9b22e5..8ded384 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -51,6 +51,7 @@ static void nlm_gc_hosts(struct net *net);
struct nlm_lookup_host_info {
const int server; /* search for server|client */
const struct sockaddr *sap; /* address to search for */
+ const struct sockaddr *src_addr; /* source address */
const size_t salen; /* it's length */
const unsigned short protocol; /* transport to search for*/
const u32 version; /* NLM version to search for */
@@ -134,7 +135,12 @@ static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni,
memcpy(nlm_addr(host), ni->sap, ni->salen);
host->h_addrlen = ni->salen;
rpc_set_port(nlm_addr(host), 0);
- host->h_srcaddrlen = 0;
+ if (ni->src_addr && ni->src_addr->sa_family != AF_UNSPEC) {
+ memcpy(nlm_srcaddr(host), ni->src_addr, ni->salen);
+ host->h_srcaddrlen = ni->salen;
+ } else {
+ host->h_srcaddrlen = 0;
+ }
host->h_rpcclnt = NULL;
host->h_name = nsm->sm_name;
@@ -209,6 +215,7 @@ static void nlm_destroy_host_locked(struct nlm_host *host)
* created and returned.
*/
struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap,
+ const struct sockaddr *srcaddr,
const size_t salen,
const unsigned short protocol,
const u32 version,
@@ -224,6 +231,7 @@ struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap,
.version = version,
.hostname = hostname,
.hostname_len = strlen(hostname),
+ .src_addr = srcaddr,
.noresvport = noresvport,
.net = net,
};
@@ -246,6 +254,13 @@ struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap,
if (!rpc_cmp_addr(nlm_addr(host), sap))
continue;
+ /* Check for local binding match only if user
+ * has specified the source-address.
+ */
+ if (srcaddr && srcaddr->sa_family != AF_UNSPEC &&
+ !rpc_cmp_addr(nlm_srcaddr(host), srcaddr))
+ continue;
+
/* Same address. Share an NSM handle if we already have one */
if (nsm == NULL)
nsm = host->h_nsmhandle;
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 43b6205..b46b0ed 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -644,6 +644,7 @@ static int nfs_start_lockd(struct nfs_server *server)
struct nlmclnt_initdata nlm_init = {
.hostname = clp->cl_hostname,
.address = (struct sockaddr *)&clp->cl_addr,
+ .srcaddr = (struct sockaddr *)&clp->srcaddr,
.addrlen = clp->cl_addrlen,
.nfs_version = clp->rpc_ops->version,
.noresvport = server->flags & NFS_MOUNT_NORESVPORT ?
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h
index 4d24d64..1a0176b 100644
--- a/include/linux/lockd/bind.h
+++ b/include/linux/lockd/bind.h
@@ -38,6 +38,7 @@ extern struct nlmsvc_binding * nlmsvc_ops;
struct nlmclnt_initdata {
const char *hostname;
const struct sockaddr *address;
+ const struct sockaddr *srcaddr;
size_t addrlen;
unsigned short protocol;
u32 nfs_version;
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index f5a051a..82c998a 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -219,6 +219,7 @@ void nlmclnt_next_cookie(struct nlm_cookie *);
* Host cache
*/
struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap,
+ const struct sockaddr *bindaddr,
const size_t salen,
const unsigned short protocol,
const u32 version,
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 34206b8..6a5fe61 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -275,6 +275,8 @@ static inline bool rpc_cmp_addr(const struct sockaddr *sap1,
return __rpc_cmp_addr4(sap1, sap2);
case AF_INET6:
return __rpc_cmp_addr6(sap1, sap2);
+ case AF_UNSPEC:
+ return true;
}
}
return false;
--
1.7.3.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [RFC 13/13] nfs: Allow up to 5000 NFSv4 connections (instead of 1024).
2013-01-21 20:45 [RFC 00/13] Allow NFS to bind to local IP address greearb
` (11 preceding siblings ...)
2013-01-21 20:45 ` [RFC 12/13] lockd: Support binding nlm client to specific address greearb
@ 2013-01-21 20:45 ` greearb
12 siblings, 0 replies; 14+ messages in thread
From: greearb @ 2013-01-21 20:45 UTC (permalink / raw)
To: linux-nfs; +Cc: Ben Greear
From: Ben Greear <greearb@candelatech.com>
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
fs/nfs/callback.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index 5088b57..ceed971 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -335,7 +335,7 @@ static struct svc_serv *nfs_callback_create_svc(int minorversion)
/* As there is only one thread we need to over-ride the
* default maximum of 80 connections
*/
- serv->sv_maxconn = 1024;
+ serv->sv_maxconn = 5000;
dprintk("nfs_callback_create_svc: service created\n");
return serv;
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
end of thread, other threads:[~2013-01-21 20:48 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-21 20:45 [RFC 00/13] Allow NFS to bind to local IP address greearb
2013-01-21 20:45 ` [RFC 01/13] sunrpc: Don't attempt to bind to AF_UNSPEC address greearb
2013-01-21 20:45 ` [RFC 02/13] nfs: Two AF_UNSPEC addresses should always match each other greearb
2013-01-21 20:45 ` [RFC 03/13] nfs: Add srcaddr member to nfs_client greearb
2013-01-21 20:45 ` [RFC 04/13] nfs: Use request destination addr as callback source addr greearb
2013-01-21 20:45 ` [RFC 05/13] nfs: Pay attention to srcaddr in v4.1 callback logic greearb
2013-01-21 20:45 ` [RFC 06/13] nfs: Use srcaddr in nfs_match_client greearb
2013-01-21 20:45 ` [RFC 07/13] nfs: Pass srcaddr into mount request greearb
2013-01-21 20:45 ` [RFC 08/13] nfs: Propagate src-addr in client code greearb
2013-01-21 20:45 ` [RFC 09/13] nfs: Bind to srcaddr in rpcb_create greearb
2013-01-21 20:45 ` [RFC 10/13] nfs: Support srcaddr= to bind to specific IP address greearb
2013-01-21 20:45 ` [RFC 11/13] nfs: Add srcaddr to /proc/fs/nfsfs/servers greearb
2013-01-21 20:45 ` [RFC 12/13] lockd: Support binding nlm client to specific address greearb
2013-01-21 20:45 ` [RFC 13/13] nfs: Allow up to 5000 NFSv4 connections (instead of 1024) greearb
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).