Skip to content

RFC NFS: Add client ability to bind to specific source-addr.

[email protected] linux-nfs 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest11 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11sunrpc: Don't attempt to bind to AF_UNSPEC address.net/sunrpc/xprtsock.c+2 -20 replies
2/11nfs: Two AF_UNSPEC addresses should always match each other.fs/nfs/client.c+2 -00 replies
3/11nfs: Add srcaddr member to nfs_client.fs/nfs/internal.h fs/nfs/super.c include/linux/nfs_fs_sb.h+11 -00 replies
4/11nfs: Use request destination addr as callback source addr.fs/nfs/callback.h fs/nfs/callback_xdr.c include/linux/sunrpc/svc.h+11 -00 replies
5/11nfs: Pay attention to srcaddr in v4.1 callback logic.fs/nfs/callback_proc.c fs/nfs/client.c fs/nfs/internal.h+30 -40 replies
6/11nfs: Use srcaddr in nfs_match_client.fs/nfs/client.c+12 -00 replies
7/11nfs: Add srcaddr to /proc/fs/nfsfs/serversfs/nfs/client.c+16 -20 replies
8/11nfs: Pass srcaddr into mount request.fs/nfs/internal.h fs/nfs/mount_clnt.c fs/nfs/super.c+4 -00 replies
9/11nfs: Propagate src-addr in client code.fs/nfs/client.c+13 -00 replies
10/11nfs: Bind to srcaddr in rpcb_create.net/sunrpc/rpcb_clnt.c net/sunrpc/sunrpc.h net/sunrpc/xprtsock.c+71 -450 replies
11/11nfs: Support srcaddr= to bind to specific IP address.fs/nfs/super.c+28 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 00/11] NFS: Add client ability to bind to specific source-addr.

From: Ben Greear <[email protected]>

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

Ben Greear (11):
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:  Add srcaddr to /proc/fs/nfsfs/servers
  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.

 fs/nfs/callback.h          |    3 ++
 fs/nfs/callback_proc.c     |    3 +-
 fs/nfs/callback_xdr.c      |    3 ++
 fs/nfs/client.c            |   72 +++++++++++++++++++++++++++++++++++++++++--
 fs/nfs/internal.h          |   10 +++++-
 fs/nfs/mount_clnt.c        |    1 +
 fs/nfs/super.c             |   33 +++++++++++++++++++-
 include/linux/nfs_fs_sb.h  |    4 ++
 include/linux/sunrpc/svc.h |    5 +++
 net/sunrpc/rpcb_clnt.c     |   28 ++++++++++++++++-
 net/sunrpc/sunrpc.h        |   45 +++++++++++++++++++++++++++
 net/sunrpc/xprtsock.c      |   47 +---------------------------
 12 files changed, 200 insertions(+), 54 deletions(-)
Signature · 1 line
1.7.3.4