Re: [PATCH 1/2] NFSv4: Fix a regression against the FreeBSD server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andre Heider wrote:
> On Wed, Jul 17, 2013 at 11:59 PM, Trond Myklebust
> <Trond.Myklebust@xxxxxxxxxx> wrote:
> > Technically, the Linux client is allowed by the NFSv4 spec to send
> > 3 word bitmaps as part of an OPEN request. However, this causes the
> > current FreeBSD server to return NFS4ERR_ATTRNOTSUPP errors.
> >
> > Fix the regression by making the Linux client use a 2 word bitmap
> > unless
> > doing NFSv4.2 with labeled NFS.
> >
> > Signed-off-by: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>
> 
> Tested-by: Andre Heider <a.heider@xxxxxxxxx>
> 
I've attached the patch I plan to commit to FreeBSD's head soon, which
fixes the server so that it checks for the high order bitmaps words
being non-zero before replying with NFS4_ERR_ATTRNOTSUPP.

The patch is pretty straightforward, but if you can apply it to your
server and test it against the unpatched Linux client, that would be
appreciated.

It will take a while for the patch to find its way to a FreeBSD release,
so having the workaround in the Linux client will be very helpful.

Thanks for reporting this, rick

--- sys/fs/nfs/nfs_commonsubs.c.orig	2013-07-18 19:15:25.000000000 -0400
+++ sys/fs/nfs/nfs_commonsubs.c	2013-07-18 19:15:58.000000000 -0400
@@ -761,21 +761,21 @@ nfsrv_getattrbits(struct nfsrv_descript 
 		error = NFSERR_BADXDR;
 		goto nfsmout;
 	}
-	if (cnt > NFSATTRBIT_MAXWORDS) {
+	if (cnt > NFSATTRBIT_MAXWORDS)
 		outcnt = NFSATTRBIT_MAXWORDS;
-		if (retnotsupp)
-			*retnotsupp = NFSERR_ATTRNOTSUPP;
-	} else {
+	else
 		outcnt = cnt;
-	}
 	NFSZERO_ATTRBIT(attrbitp);
 	if (outcnt > 0) {
 		NFSM_DISSECT(tl, u_int32_t *, outcnt * NFSX_UNSIGNED);
 		for (i = 0; i < outcnt; i++)
 			attrbitp->bits[i] = fxdr_unsigned(u_int32_t, *tl++);
 	}
-	if (cnt > outcnt)
-		error = nfsm_advance(nd, (cnt - outcnt) * NFSX_UNSIGNED, -1);
+	for (i = 0; i < (cnt - outcnt); i++) {
+		NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED);
+		if (retnotsupp != NULL && *tl != 0)
+			*retnotsupp = NFSERR_ATTRNOTSUPP;
+	}
 	if (cntp)
 		*cntp = NFSX_UNSIGNED + (cnt * NFSX_UNSIGNED);
 nfsmout:

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux