View | Details | Raw Unified | Return to bug 228497 | Differences between
and this patch

Collapse All | Expand All

(-)fs/nfsserver/nfs_nfsdstate.c (-2 / +14 lines)
Lines 180-188 nfsrv_setclient(struct nfsrv_descript *n Link Here
180
    nfsquad_t *clientidp, nfsquad_t *confirmp, NFSPROC_T *p)
180
    nfsquad_t *clientidp, nfsquad_t *confirmp, NFSPROC_T *p)
181
{
181
{
182
	struct nfsclient *clp = NULL, *new_clp = *new_clpp;
182
	struct nfsclient *clp = NULL, *new_clp = *new_clpp;
183
	int i, error = 0;
183
	int i, error = 0, ret;
184
	struct nfsstate *stp, *tstp;
184
	struct nfsstate *stp, *tstp;
185
	struct sockaddr_in *sad, *rad;
185
	struct sockaddr_in *sad, *rad;
186
	struct nfsdsession *sep, *nsep;
186
	int zapit = 0, gotit, hasstate = 0, igotlock;
187
	int zapit = 0, gotit, hasstate = 0, igotlock;
187
	static u_int64_t confirm_index = 0;
188
	static u_int64_t confirm_index = 0;
188
189
Lines 352-357 nfsrv_setclient(struct nfsrv_descript *n Link Here
352
		 * can be thrown away once the SETCLIENTID_CONFIRM occurs.
353
		 * can be thrown away once the SETCLIENTID_CONFIRM occurs.
353
		 */
354
		 */
354
		LIST_REMOVE(clp, lc_hash);
355
		LIST_REMOVE(clp, lc_hash);
356
357
		/* Get rid of all sessions on this clientid. */
358
		LIST_FOREACH_SAFE(sep, &clp->lc_session, sess_list, nsep) {
359
			ret = nfsrv_freesession(sep, NULL);
360
			if (ret != 0)
361
				printf("nfsrv_setclient: verifier changed free"
362
				    " session failed=%d\n", ret);
363
		}
364
355
		new_clp->lc_flags |= LCL_NEEDSCONFIRM;
365
		new_clp->lc_flags |= LCL_NEEDSCONFIRM;
356
		if ((nd->nd_flag & ND_NFSV41) != 0)
366
		if ((nd->nd_flag & ND_NFSV41) != 0)
357
			new_clp->lc_confirm.lval[0] = confirmp->lval[0] =
367
			new_clp->lc_confirm.lval[0] = confirmp->lval[0] =
Lines 387-392 nfsrv_setclient(struct nfsrv_descript *n Link Here
387
			LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash)
397
			LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash)
388
				tstp->ls_clp = new_clp;
398
				tstp->ls_clp = new_clp;
389
		}
399
		}
400
		LIST_INIT(&new_clp->lc_session);
390
		LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp,
401
		LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp,
391
		    lc_hash);
402
		    lc_hash);
392
		nfsstatsv1.srvclients++;
403
		nfsstatsv1.srvclients++;
Lines 451-456 nfsrv_setclient(struct nfsrv_descript *n Link Here
451
			LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash)
462
			LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash)
452
				tstp->ls_clp = new_clp;
463
				tstp->ls_clp = new_clp;
453
		}
464
		}
465
		LIST_INIT(&new_clp->lc_session);
454
		LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp,
466
		LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp,
455
		    lc_hash);
467
		    lc_hash);
456
		nfsstatsv1.srvclients++;
468
		nfsstatsv1.srvclients++;
Lines 5982-5988 nfsrv_freesession(struct nfsdsession *se Link Here
5982
		if (sep->sess_refcnt > 0) {
5994
		if (sep->sess_refcnt > 0) {
5983
			NFSUNLOCKSESSION(shp);
5995
			NFSUNLOCKSESSION(shp);
5984
			NFSUNLOCKSTATE();
5996
			NFSUNLOCKSTATE();
5985
			return (0);
5997
			return (NFSERR_BACKCHANBUSY);
5986
		}
5998
		}
5987
		LIST_REMOVE(sep, sess_hash);
5999
		LIST_REMOVE(sep, sess_hash);
5988
		LIST_REMOVE(sep, sess_list);
6000
		LIST_REMOVE(sep, sess_list);

Return to bug 228497