···303 struct rpc_cred *newcred = NULL;304 rpc_authflavor_t flavor;30500000000000306 if (test_bit(sp4_mode, &clp->cl_sp4_flags)) {307 spin_lock(&clp->cl_lock);308 if (clp->cl_machine_cred != NULL)
···303 struct rpc_cred *newcred = NULL;304 rpc_authflavor_t flavor;305306+ if (sp4_mode == NFS_SP4_MACH_CRED_CLEANUP ||307+ sp4_mode == NFS_SP4_MACH_CRED_PNFS_CLEANUP) {308+ /* Using machine creds for cleanup operations309+ * is only relevent if the client credentials310+ * might expire. So don't bother for311+ * RPC_AUTH_UNIX. If file was only exported to312+ * sec=sys, the PUTFH would fail anyway.313+ */314+ if ((*clntp)->cl_auth->au_flavor == RPC_AUTH_UNIX)315+ return false;316+ }317 if (test_bit(sp4_mode, &clp->cl_sp4_flags)) {318 spin_lock(&clp->cl_lock);319 if (clp->cl_machine_cred != NULL)
+40-37
fs/nfs/pagelist.c
···682 const struct nfs_pgio_completion_ops *compl_ops,683 const struct nfs_rw_ops *rw_ops,684 size_t bsize,685- int io_flags,686- gfp_t gfp_flags)687{688- struct nfs_pgio_mirror *new;689- int i;690-691 desc->pg_moreio = 0;692 desc->pg_inode = inode;693 desc->pg_ops = pg_ops;···699 desc->pg_mirror_count = 1;700 desc->pg_mirror_idx = 0;701702- if (pg_ops->pg_get_mirror_count) {703- /* until we have a request, we don't have an lseg and no704- * idea how many mirrors there will be */705- new = kcalloc(NFS_PAGEIO_DESCRIPTOR_MIRROR_MAX,706- sizeof(struct nfs_pgio_mirror), gfp_flags);707- desc->pg_mirrors_dynamic = new;708- desc->pg_mirrors = new;709-710- for (i = 0; i < NFS_PAGEIO_DESCRIPTOR_MIRROR_MAX; i++)711- nfs_pageio_mirror_init(&desc->pg_mirrors[i], bsize);712- } else {713- desc->pg_mirrors_dynamic = NULL;714- desc->pg_mirrors = desc->pg_mirrors_static;715- nfs_pageio_mirror_init(&desc->pg_mirrors[0], bsize);716- }717}718-EXPORT_SYMBOL_GPL(nfs_pageio_init);719720/**721 * nfs_pgio_result - Basic pageio error handling···819 return ret;820}82100000000000000000000822/*823 * nfs_pageio_setup_mirroring - determine if mirroring is to be used824 * by calling the pg_get_mirror_count op825 */826-static int nfs_pageio_setup_mirroring(struct nfs_pageio_descriptor *pgio,827 struct nfs_page *req)828{829- int mirror_count = 1;830831- if (!pgio->pg_ops->pg_get_mirror_count)832- return 0;00833834- mirror_count = pgio->pg_ops->pg_get_mirror_count(pgio, req);000835836- if (pgio->pg_error < 0)837- return pgio->pg_error;838-839- if (!mirror_count || mirror_count > NFS_PAGEIO_DESCRIPTOR_MIRROR_MAX)840- return -EINVAL;841-842- if (WARN_ON_ONCE(!pgio->pg_mirrors_dynamic))843- return -EINVAL;844-845 pgio->pg_mirror_count = mirror_count;846-847- return 0;848}849850/*
···682 const struct nfs_pgio_completion_ops *compl_ops,683 const struct nfs_rw_ops *rw_ops,684 size_t bsize,685+ int io_flags)0686{000687 desc->pg_moreio = 0;688 desc->pg_inode = inode;689 desc->pg_ops = pg_ops;···703 desc->pg_mirror_count = 1;704 desc->pg_mirror_idx = 0;705706+ desc->pg_mirrors_dynamic = NULL;707+ desc->pg_mirrors = desc->pg_mirrors_static;708+ nfs_pageio_mirror_init(&desc->pg_mirrors[0], bsize);000000000000709}0710711/**712 * nfs_pgio_result - Basic pageio error handling···836 return ret;837}838839+static struct nfs_pgio_mirror *840+nfs_pageio_alloc_mirrors(struct nfs_pageio_descriptor *desc,841+ unsigned int mirror_count)842+{843+ struct nfs_pgio_mirror *ret;844+ unsigned int i;845+846+ kfree(desc->pg_mirrors_dynamic);847+ desc->pg_mirrors_dynamic = NULL;848+ if (mirror_count == 1)849+ return desc->pg_mirrors_static;850+ ret = kmalloc_array(mirror_count, sizeof(*ret), GFP_NOFS);851+ if (ret != NULL) {852+ for (i = 0; i < mirror_count; i++)853+ nfs_pageio_mirror_init(&ret[i], desc->pg_bsize);854+ desc->pg_mirrors_dynamic = ret;855+ }856+ return ret;857+}858+859/*860 * nfs_pageio_setup_mirroring - determine if mirroring is to be used861 * by calling the pg_get_mirror_count op862 */863+static void nfs_pageio_setup_mirroring(struct nfs_pageio_descriptor *pgio,864 struct nfs_page *req)865{866+ unsigned int mirror_count = 1;867868+ if (pgio->pg_ops->pg_get_mirror_count)869+ mirror_count = pgio->pg_ops->pg_get_mirror_count(pgio, req);870+ if (mirror_count == pgio->pg_mirror_count || pgio->pg_error < 0)871+ return;872873+ if (!mirror_count || mirror_count > NFS_PAGEIO_DESCRIPTOR_MIRROR_MAX) {874+ pgio->pg_error = -EINVAL;875+ return;876+ }877878+ pgio->pg_mirrors = nfs_pageio_alloc_mirrors(pgio, mirror_count);879+ if (pgio->pg_mirrors == NULL) {880+ pgio->pg_error = -ENOMEM;881+ pgio->pg_mirrors = pgio->pg_mirrors_static;882+ mirror_count = 1;883+ }000884 pgio->pg_mirror_count = mirror_count;00885}886887/*
···1691 rpc_authflavor_t *server_authlist, unsigned int count)1692{1693 rpc_authflavor_t flavor = RPC_AUTH_MAXFLAVOR;01694 unsigned int i;1695- int use_auth_null = false;16961697 /*1698 * If the sec= mount option is used, the specified flavor or AUTH_NULL···1701 * AUTH_NULL has a special meaning when it's in the server list - it1702 * means that the server will ignore the rpc creds, so any flavor1703 * can be used but still use the sec= that was specified.00001704 */1705 for (i = 0; i < count; i++) {1706 flavor = server_authlist[i];···1713 goto out;17141715 if (flavor == RPC_AUTH_NULL)1716- use_auth_null = true;1717 }17181719- if (use_auth_null) {1720- flavor = RPC_AUTH_NULL;1721 goto out;1722 }1723
···1691 rpc_authflavor_t *server_authlist, unsigned int count)1692{1693 rpc_authflavor_t flavor = RPC_AUTH_MAXFLAVOR;1694+ bool found_auth_null = false;1695 unsigned int i;016961697 /*1698 * If the sec= mount option is used, the specified flavor or AUTH_NULL···1701 * AUTH_NULL has a special meaning when it's in the server list - it1702 * means that the server will ignore the rpc creds, so any flavor1703 * can be used but still use the sec= that was specified.1704+ *1705+ * Note also that the MNT procedure in MNTv1 does not return a list1706+ * of supported security flavors. In this case, nfs_mount() fabricates1707+ * a security flavor list containing just AUTH_NULL.1708 */1709 for (i = 0; i < count; i++) {1710 flavor = server_authlist[i];···1709 goto out;17101711 if (flavor == RPC_AUTH_NULL)1712+ found_auth_null = true;1713 }17141715+ if (found_auth_null) {1716+ flavor = args->auth_info.flavors[0];1717 goto out;1718 }1719
···125 const struct nfs_pgio_completion_ops *compl_ops,126 const struct nfs_rw_ops *rw_ops,127 size_t bsize,128- int how,129- gfp_t gfp_flags);130extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *,131 struct nfs_page *);132extern int nfs_pageio_resend(struct nfs_pageio_descriptor *,
···125 const struct nfs_pgio_completion_ops *compl_ops,126 const struct nfs_rw_ops *rw_ops,127 size_t bsize,128+ int how);0129extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *,130 struct nfs_page *);131extern int nfs_pageio_resend(struct nfs_pageio_descriptor *,
+8
net/sunrpc/clnt.c
···1903 task->tk_status = 0;1904 switch (status) {1905 case -ECONNREFUSED:000000001906 case -ECONNRESET:1907 case -ECONNABORTED:1908 case -ENETUNREACH:
···1903 task->tk_status = 0;1904 switch (status) {1905 case -ECONNREFUSED:1906+ /* A positive refusal suggests a rebind is needed. */1907+ if (RPC_IS_SOFTCONN(task))1908+ break;1909+ if (clnt->cl_autobind) {1910+ rpc_force_rebind(clnt);1911+ task->tk_action = call_bind;1912+ return;1913+ }1914 case -ECONNRESET:1915 case -ECONNABORTED:1916 case -ENETUNREACH: