Project

General

Profile

Bug #1588 ยป 0001-Bug-fixed-nfs4-mirror-mounting-facility-hangs-when-t.patch

Simon K, 2012-01-25 09:52 AM

View differences:

usr/src/uts/common/fs/nfs/nfs4_stub_vnops.c
208 208
static int	nfs4_trigger_mount(vnode_t *, cred_t *, vnode_t **);
209 209
static int	nfs4_trigger_domount(vnode_t *, domount_args_t *, vfs_t **,
210 210
    cred_t *, vnode_t **);
211
static domount_args_t  *nfs4_trigger_domount_args_create(vnode_t *, cred_t *);
211
static int 	nfs4_trigger_domount_args_create(vnode_t *, cred_t *,
212
    domount_args_t **dmap);
212 213
static void	nfs4_trigger_domount_args_destroy(domount_args_t *dma,
213 214
    vnode_t *vp);
214 215
static ephemeral_servinfo_t *nfs4_trigger_esi_create(vnode_t *, servinfo4_t *,
......
835 836

  
836 837
	must_unlock = TRUE;
837 838

  
838
	dma = nfs4_trigger_domount_args_create(vp, cr);
839
	if (dma == NULL) {
840
		error = EINVAL;
839
	error = nfs4_trigger_domount_args_create(vp, cr, &dma);
840
	if (error)
841 841
		goto done;
842
	}
843 842

  
844 843
	/*
845 844
	 * Note that since we define mirror mounts to work
......
898 897
/*
899 898
 * Collect together both the generic & mount-type specific args.
900 899
 */
901
static domount_args_t *
902
nfs4_trigger_domount_args_create(vnode_t *vp, cred_t *cr)
900
static int
901
nfs4_trigger_domount_args_create(vnode_t *vp, cred_t *cr, domount_args_t **dmap)
903 902
{
904 903
	int nointr;
905 904
	char *hostlist;
905
	domount_args_t *dma;
906 906
	servinfo4_t *svp;
907 907
	struct nfs_args *nargs, *nargs_head;
908 908
	enum clnt_stat status;
909 909
	ephemeral_servinfo_t *esi, *esi_first;
910
	domount_args_t *dma;
911 910
	mntinfo4_t *mi = VTOMI4(vp);
912 911

  
913 912
	nointr = !(mi->mi_flags & MI4_INT);
......
920 919
		esi_first = nfs4_trigger_esi_create(vp, svp, cr);
921 920
		if (esi_first == NULL) {
922 921
			kmem_free(hostlist, MAXPATHLEN);
923
			return (NULL);
922
			return EINVAL;
924 923
		}
925 924

  
926 925
		(void) strlcpy(hostlist, esi_first->esi_hostname, MAXPATHLEN);
......
990 989
			/* check if the server is responding */
991 990
			status = nfs4_trigger_ping_server(svp, nointr);
992 991
			/* if the server did not respond, ignore it */
993
			if (status != RPC_SUCCESS)
992
			if (status != RPC_SUCCESS) {
993
				if (status == RPC_INTR)
994
					return EINTR;
994 995
				continue;
996
			}
995 997

  
996 998
			esi = nfs4_trigger_esi_create(vp, svp, cr);
997 999
			if (esi == NULL)
......
1039 1041
	dma->dma_esi = esi_first;
1040 1042
	dma->dma_hostlist = hostlist;
1041 1043
	dma->dma_nargs = nargs_head;
1044
	*dmap = dma;
1042 1045

  
1043
	return (dma);
1046
	return 0;
1044 1047
}
1045 1048

  
1046 1049
static void
    (1-1/1)