Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 159363 Details for
Bug 248149
[RFE][PATCH] adding a mechanism to allow multihomed NFS clients to use a specific address
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch -- add new mount option "srcaddr="
nfs-2.6-srcaddr.patch (text/plain), 7.30 KB, created by
Jeff Layton
on 2007-07-16 19:30:40 UTC
(
hide
)
Description:
patch -- add new mount option "srcaddr="
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2007-07-16 19:30:40 UTC
Size:
7.30 KB
patch
obsolete
>diff --git a/fs/nfs/client.c b/fs/nfs/client.c >index ccb4550..f284cc2 100644 >--- a/fs/nfs/client.c >+++ b/fs/nfs/client.c >@@ -376,6 +376,7 @@ static int nfs_create_rpc_client(struct nfs_client *clp, int proto, > .protocol = proto, > .address = (struct sockaddr *)&clp->cl_addr, > .addrsize = sizeof(clp->cl_addr), >+ .saddress = (struct sockaddr *)&clp->cl_srcaddr, > .timeout = &timeparms, > .servername = clp->cl_hostname, > .program = &nfs_program, >@@ -514,6 +515,7 @@ static int nfs_init_client(struct nfs_client *clp, const struct nfs_mount_data * > > /* Check NFS protocol revision and initialize RPC op vector */ > clp->rpc_ops = &nfs_v2_clientops; >+ clp->cl_srcaddr = data->srcaddr; > #ifdef CONFIG_NFS_V3 > if (clp->cl_nfsversion == 3) > clp->rpc_ops = &nfs_v3_clientops; >@@ -872,7 +874,7 @@ error: > */ > static int nfs4_set_client(struct nfs_server *server, > const char *hostname, const struct sockaddr_in *addr, >- const char *ip_addr, >+ const struct sockaddr_in * srcaddr, const char *ip_addr, > rpc_authflavor_t authflavour, > int proto, int timeo, int retrans) > { >@@ -887,6 +889,9 @@ static int nfs4_set_client(struct nfs_server *server, > error = PTR_ERR(clp); > goto error; > } >+ >+ clp->cl_srcaddr = *srcaddr; >+ > error = nfs4_init_client(clp, proto, timeo, retrans, ip_addr, authflavour); > if (error < 0) > goto error_put; >@@ -940,6 +945,7 @@ static int nfs4_init_server(struct nfs_server *server, > struct nfs_server *nfs4_create_server(const struct nfs4_mount_data *data, > const char *hostname, > const struct sockaddr_in *addr, >+ const struct sockaddr_in *srcaddr, > const char *mntpath, > const char *ip_addr, > rpc_authflavor_t authflavour, >@@ -956,8 +962,9 @@ struct nfs_server *nfs4_create_server(const struct nfs4_mount_data *data, > return ERR_PTR(-ENOMEM); > > /* Get a client record */ >- error = nfs4_set_client(server, hostname, addr, ip_addr, authflavour, >- data->proto, data->timeo, data->retrans); >+ error = nfs4_set_client(server, hostname, addr, srcaddr, ip_addr, >+ authflavour, data->proto, data->timeo, >+ data->retrans); > if (error < 0) > goto error; > >@@ -1026,7 +1033,7 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data, > /* Get a client representation. > * Note: NFSv4 always uses TCP, */ > error = nfs4_set_client(server, data->hostname, data->addr, >- parent_client->cl_ipaddr, >+ data->srcaddr, parent_client->cl_ipaddr, > data->authflavor, > parent_server->client->cl_xprt->prot, > parent_client->retrans_timeo, >diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h >index 76cf55d..daf9cde 100644 >--- a/fs/nfs/internal.h >+++ b/fs/nfs/internal.h >@@ -24,6 +24,7 @@ struct nfs_clone_mount { > char *hostname; > char *mnt_path; > struct sockaddr_in *addr; >+ struct sockaddr_in *srcaddr; > rpc_authflavor_t authflavor; > }; > >diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c >diff --git a/fs/nfs/super.c b/fs/nfs/super.c >index a2b1af8..7b7793a 100644 >--- a/fs/nfs/super.c >+++ b/fs/nfs/super.c >@@ -81,6 +81,7 @@ struct nfs_parsed_mount_data { > > struct { > struct sockaddr_in address; >+ struct sockaddr_in source_address; > char *hostname; > char *export_path; > unsigned int program; >@@ -117,6 +118,7 @@ enum { > /* Mount options that take string arguments */ > Opt_sec, Opt_proto, Opt_mountproto, > Opt_addr, Opt_mounthost, Opt_clientaddr, >+ Opt_srcaddr, > > /* Mount options that are ignored */ > Opt_userspace, Opt_deprecated, >@@ -176,6 +178,7 @@ static match_table_t nfs_mount_option_tokens = { > { Opt_addr, "addr=%s" }, > { Opt_clientaddr, "clientaddr=%s" }, > { Opt_mounthost, "mounthost=%s" }, >+ { Opt_srcaddr, "srcaddr=%s" }, > > { Opt_err, NULL } > }; >@@ -953,6 +956,15 @@ static int nfs_parse_mount_options(char *raw, > in_aton(string); > kfree(string); > break; >+ case Opt_srcaddr: >+ string = match_strdup(args); >+ if (string == NULL) >+ goto out_nomem; >+ mnt->nfs_server.source_address.sin_family = AF_INET; >+ mnt->nfs_server.source_address.sin_addr.s_addr = >+ in_aton(string); >+ kfree(string); >+ break; > case Opt_clientaddr: > string = match_strdup(args); > if (string == NULL) >@@ -1181,6 +1193,7 @@ static int nfs_validate_mount_data(struct nfs_mount_data **options, > data->acdirmin = args.acdirmin; > data->acdirmax = args.acdirmax; > data->addr = args.nfs_server.address; >+ data->srcaddr = args.nfs_server.source_address; > data->namlen = args.namlen; > data->bsize = args.bsize; > data->pseudoflavor = args.auth_flavors[0]; >@@ -1551,6 +1564,7 @@ static void nfs4_fill_super(struct super_block *sb) > static int nfs4_validate_mount_data(struct nfs4_mount_data **options, > const char *dev_name, > struct sockaddr_in *addr, >+ struct sockaddr_in *srcaddr, > rpc_authflavor_t *authflavour, > char **hostname, > char **mntpath, >@@ -1624,6 +1638,7 @@ static int nfs4_validate_mount_data(struct nfs4_mount_data **options, > &args.nfs_server.address)) > return -EINVAL; > *addr = args.nfs_server.address; >+ *srcaddr = args.nfs_server.source_address; > > switch (args.auth_flavor_len) { > case 0: >@@ -1714,7 +1729,7 @@ static int nfs4_get_sb(struct file_system_type *fs_type, > struct nfs4_mount_data *data = raw_data; > struct super_block *s; > struct nfs_server *server; >- struct sockaddr_in addr; >+ struct sockaddr_in addr, srcaddr; > rpc_authflavor_t authflavour; > struct nfs_fh mntfh; > struct dentry *mntroot; >@@ -1723,13 +1738,14 @@ static int nfs4_get_sb(struct file_system_type *fs_type, > int error; > > /* Validate the mount data */ >- error = nfs4_validate_mount_data(&data, dev_name, &addr, &authflavour, >- &hostname, &mntpath, &ip_addr); >+ error = nfs4_validate_mount_data(&data, dev_name, &addr, &srcaddr, >+ &authflavour, &hostname, &mntpath, >+ &ip_addr); > if (error < 0) > goto out; > > /* Get a volume representation */ >- server = nfs4_create_server(data, hostname, &addr, mntpath, ip_addr, >+ server = nfs4_create_server(data, hostname, &addr, &srcaddr, mntpath, ip_addr, > authflavour, &mntfh); > if (IS_ERR(server)) { > error = PTR_ERR(server); >diff --git a/include/linux/nfs4_mount.h b/include/linux/nfs4_mount.h >diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h >index 0cac49b..6732a26 100644 >--- a/include/linux/nfs_fs_sb.h >+++ b/include/linux/nfs_fs_sb.h >@@ -20,6 +20,7 @@ struct nfs_client { > #define NFS_CS_IDMAP 2 /* - idmap started */ > #define NFS_CS_RENEWD 3 /* - renewd started */ > struct sockaddr_in cl_addr; /* server identifier */ >+ struct sockaddr_in cl_srcaddr; /* optional source addr */ > char * cl_hostname; /* hostname of server */ > struct list_head cl_share_link; /* link in global client list */ > struct list_head cl_superblocks; /* List of nfs_server structs */ >diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h >index a3ade89..53faee4 100644 >--- a/include/linux/nfs_mount.h >+++ b/include/linux/nfs_mount.h >@@ -20,7 +20,7 @@ > * mount-to-kernel version compatibility. Some of these aren't used yet > * but here they are anyway. > */ >-#define NFS_MOUNT_VERSION 6 >+#define NFS_MOUNT_VERSION 7 > #define NFS_MAX_CONTEXT_LEN 256 > > struct nfs_mount_data { >@@ -43,6 +43,7 @@ struct nfs_mount_data { > struct nfs3_fh root; /* 4 */ > int pseudoflavor; /* 5 */ > char context[NFS_MAX_CONTEXT_LEN + 1]; /* 6 */ >+ struct sockaddr_in srcaddr; /* 7 */ > }; > > /* bits in the flags field */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 248149
:
159189
| 159363 |
159516