From eb04876145e5cc48fceaf4d286e801f10776879d Mon Sep 17 00:00:00 2001 From: zoulasc Date: Thu, 3 Mar 2016 13:24:10 -0500 Subject: [PATCH] The nfs_quick_reply() function needs to know the current RPC transport outside of the NFS LOOKUP method call. It needs this to reply to the NFS LOOKUP call that initiated the mount. Now there are functions that avoid transport corruption if another request comes in during the backgroud mount make nfs_quick_reply() use them. From: Ian Kent --- amd/amfs_generic.c | 3 +-- amd/map.c | 2 +- amd/nfs_subr.c | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/amd/amfs_generic.c b/amd/amfs_generic.c index c352a322..86d0ab7a 100644 --- a/amd/amfs_generic.c +++ b/amd/amfs_generic.c @@ -1129,8 +1129,7 @@ amfs_generic_mount_child(am_node *new_mp, int *error_return) */ if (current_transp && !new_mp->am_transp) { dlog("Saving RPC transport for %s", new_mp->am_path); - new_mp->am_transp = (SVCXPRT *) xmalloc(sizeof(SVCXPRT)); - *(new_mp->am_transp) = *current_transp; + new_mp->am_transp = get_nfs_xprt(current_transp); } if (error && new_mp->am_al && new_mp->am_al->al_mnt && (new_mp->am_al->al_mnt->mf_ops == &amfs_error_ops)) diff --git a/amd/map.c b/amd/map.c index 0d404cfd..bcb21562 100644 --- a/amd/map.c +++ b/amd/map.c @@ -471,7 +471,7 @@ free_map(am_node *mp) XFREE(mp->am_name); XFREE(mp->am_path); XFREE(mp->am_pref); - XFREE(mp->am_transp); + put_nfs_xprt(mp->am_transp); if (mp->am_al) free_loc(mp->am_al); diff --git a/amd/nfs_subr.c b/amd/nfs_subr.c index 0a43b988..07d960d7 100644 --- a/amd/nfs_subr.c +++ b/amd/nfs_subr.c @@ -291,7 +291,8 @@ nfs_quick_reply(am_node *mp, int error) /* * Free up transp. It's only used for one reply. */ - XFREE(mp->am_transp); + put_nfs_xprt(mp->am_transp); + mp->am_transp = NULL; dlog("Quick reply sent for %s", mp->am_al->al_mnt->mf_mount); } } -- 2.34.1