nfs41: allow LD to choose DS connection auth flavor
authorPeng Tao <tao.peng@primarydata.com>
Thu, 29 May 2014 13:07:00 +0000 (21:07 +0800)
committerTom Haynes <loghyr@primarydata.com>
Tue, 3 Feb 2015 19:06:33 +0000 (11:06 -0800)
flexfile layout may use different auth flavor as specified by MDS.

Reviewed-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Tom Haynes <Thomas.Haynes@primarydata.com>
fs/nfs/filelayout/filelayoutdev.c
fs/nfs/internal.h
fs/nfs/nfs4client.c
fs/nfs/pnfs.h
fs/nfs/pnfs_nfs.c

index 27bdd8ce177e7136bdc874cda45245dd1a937ff7..5e4b0cea84c8f30d17fc9c3026acdc4368a41238 100644 (file)
@@ -278,7 +278,8 @@ nfs4_fl_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx)
                goto out_test_devid;
 
        nfs4_pnfs_ds_connect(s, ds, devid, dataserver_timeo,
-                            dataserver_retrans);
+                            dataserver_retrans,
+                            s->nfs_client->cl_rpcclient->cl_auth->au_flavor);
 
 out_test_devid:
        if (filelayout_test_devid_unavailable(devid))
index efaa31c70fbe1c43d265c51bc542a8270348c339..7d7c36ff09faac564de01fa72137985cc31db714 100644 (file)
@@ -189,7 +189,8 @@ extern struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp,
                                             const struct sockaddr *ds_addr,
                                             int ds_addrlen, int ds_proto,
                                             unsigned int ds_timeo,
-                                            unsigned int ds_retrans);
+                                            unsigned int ds_retrans,
+                                            rpc_authflavor_t au_flavor);
 extern struct rpc_clnt *nfs4_find_or_create_ds_client(struct nfs_client *,
                                                struct inode *);
 #ifdef CONFIG_PROC_FS
index 953daa44a28232d6863da375e59d44a0b42f49b6..62d93a116790e08ec7f936a3f180f3d5484dcc0d 100644 (file)
@@ -849,7 +849,8 @@ error:
  */
 struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp,
                const struct sockaddr *ds_addr, int ds_addrlen,
-               int ds_proto, unsigned int ds_timeo, unsigned int ds_retrans)
+               int ds_proto, unsigned int ds_timeo, unsigned int ds_retrans,
+               rpc_authflavor_t au_flavor)
 {
        struct nfs_client_initdata cl_init = {
                .addr = ds_addr,
@@ -874,7 +875,7 @@ struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp,
         */
        nfs_init_timeout_values(&ds_timeout, ds_proto, ds_timeo, ds_retrans);
        clp = nfs_get_client(&cl_init, &ds_timeout, mds_clp->cl_ipaddr,
-                            mds_clp->cl_rpcclient->cl_auth->au_flavor);
+                            au_flavor);
 
        dprintk("<-- %s %p\n", __func__, clp);
        return clp;
index 9a8937c31d973db44f3d468df8aaf8250753b283..2ea9e9a7d85e7193bd9920a226358313b0613561 100644 (file)
@@ -314,7 +314,7 @@ struct nfs4_pnfs_ds *nfs4_pnfs_ds_add(struct list_head *dsaddrs,
                                      gfp_t gfp_flags);
 void nfs4_pnfs_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds,
                          struct nfs4_deviceid_node *devid, unsigned int timeo,
-                         unsigned int retrans);
+                         unsigned int retrans, rpc_authflavor_t au_flavor);
 struct nfs4_pnfs_ds_addr *nfs4_decode_mp_ds_addr(struct net *net,
                                                 struct xdr_stream *xdr,
                                                 gfp_t gfp_flags);
index 5a92e76c6c53b1db99ea07e34441dc09a4465921..106ee08ef52fa11f6735e7a8ccbcd12d3ce5e026 100644 (file)
@@ -553,7 +553,8 @@ static void nfs4_clear_ds_conn_bit(struct nfs4_pnfs_ds *ds)
 static int _nfs4_pnfs_ds_connect(struct nfs_server *mds_srv,
                                 struct nfs4_pnfs_ds *ds,
                                 unsigned int timeo,
-                                unsigned int retrans)
+                                unsigned int retrans,
+                                rpc_authflavor_t au_flavor)
 {
        struct nfs_client *clp = ERR_PTR(-EIO);
        struct nfs4_pnfs_ds_addr *da;
@@ -569,7 +570,7 @@ static int _nfs4_pnfs_ds_connect(struct nfs_server *mds_srv,
                clp = nfs4_set_ds_client(mds_srv->nfs_client,
                                        (struct sockaddr *)&da->da_addr,
                                        da->da_addrlen, IPPROTO_TCP,
-                                       timeo, retrans);
+                                       timeo, retrans, au_flavor);
                if (!IS_ERR(clp))
                        break;
        }
@@ -600,12 +601,13 @@ out_put:
  */
 void nfs4_pnfs_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds,
                          struct nfs4_deviceid_node *devid, unsigned int timeo,
-                         unsigned int retrans)
+                         unsigned int retrans, rpc_authflavor_t au_flavor)
 {
        if (test_and_set_bit(NFS4DS_CONNECTING, &ds->ds_state) == 0) {
                int err = 0;
 
-               err = _nfs4_pnfs_ds_connect(mds_srv, ds, timeo, retrans);
+               err = _nfs4_pnfs_ds_connect(mds_srv, ds, timeo,
+                                           retrans, au_flavor);
                if (err)
                        nfs4_mark_deviceid_unavailable(devid);
                nfs4_clear_ds_conn_bit(ds);