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

Collapse All | Expand All

(-)fs/nfsserver/nfs_nfsdserv.c (-2 / +4 lines)
Lines 3235-3240 nfsrvd_opendowngrade(struct nfsrv_descri Link Here
3235
	tl += (NFSX_STATEIDOTHER / NFSX_UNSIGNED);
3235
	tl += (NFSX_STATEIDOTHER / NFSX_UNSIGNED);
3236
	stp->ls_seq = fxdr_unsigned(u_int32_t, *tl++);
3236
	stp->ls_seq = fxdr_unsigned(u_int32_t, *tl++);
3237
	i = fxdr_unsigned(int, *tl++);
3237
	i = fxdr_unsigned(int, *tl++);
3238
	if ((nd->nd_flag & ND_NFSV41) != 0)
3239
		i &= ~NFSV4OPEN_WANTDELEGMASK;
3238
	switch (i) {
3240
	switch (i) {
3239
	case NFSV4OPEN_ACCESSREAD:
3241
	case NFSV4OPEN_ACCESSREAD:
3240
		stp->ls_flags = (NFSLCK_READACCESS | NFSLCK_DOWNGRADE);
3242
		stp->ls_flags = (NFSLCK_READACCESS | NFSLCK_DOWNGRADE);
Lines 3247-3253 nfsrvd_opendowngrade(struct nfsrv_descri Link Here
3247
		    NFSLCK_DOWNGRADE);
3249
		    NFSLCK_DOWNGRADE);
3248
		break;
3250
		break;
3249
	default:
3251
	default:
3250
		nd->nd_repstat = NFSERR_BADXDR;
3252
		nd->nd_repstat = NFSERR_INVAL;
3251
	}
3253
	}
3252
	i = fxdr_unsigned(int, *tl);
3254
	i = fxdr_unsigned(int, *tl);
3253
	switch (i) {
3255
	switch (i) {
Lines 3263-3269 nfsrvd_opendowngrade(struct nfsrv_descri Link Here
3263
		stp->ls_flags |= (NFSLCK_READDENY | NFSLCK_WRITEDENY);
3265
		stp->ls_flags |= (NFSLCK_READDENY | NFSLCK_WRITEDENY);
3264
		break;
3266
		break;
3265
	default:
3267
	default:
3266
		nd->nd_repstat = NFSERR_BADXDR;
3268
		nd->nd_repstat = NFSERR_INVAL;
3267
	}
3269
	}
3268
3270
3269
	clientid.lval[0] = stp->ls_stateid.other[0];
3271
	clientid.lval[0] = stp->ls_stateid.other[0];
(-)fs/nfsserver/nfs_nfsdstate.c (-2 / +3 lines)
Lines 3386-3395 nfsrv_openupdate(vnode_t vp, struct nfss Link Here
3386
	} else {
3386
	} else {
3387
		/*
3387
		/*
3388
		 * Update the share bits, making sure that the new set are a
3388
		 * Update the share bits, making sure that the new set are a
3389
		 * subset of the old ones.
3389
		 * subset of the access bits and a superset of the deny bits.
3390
		 */
3390
		 */
3391
		bits = (new_stp->ls_flags & NFSLCK_SHAREBITS);
3391
		bits = (new_stp->ls_flags & NFSLCK_SHAREBITS);
3392
		if (~(stp->ls_flags) & bits) {
3392
		if ((~(stp->ls_flags) & (bits & NFSLCK_ACCESSBITS)) ||
3393
		    ((stp->ls_flags & NFSLCK_DENYBITS) & ~bits)) {
3393
			NFSUNLOCKSTATE();
3394
			NFSUNLOCKSTATE();
3394
			error = NFSERR_INVAL;
3395
			error = NFSERR_INVAL;
3395
			goto out;
3396
			goto out;

Return to bug 227214