linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rick Macklem <rmacklem@uoguelph.ca>
To: Andre Heider <a.heider@gmail.com>
Cc: Chuck Lever <chuck.lever@oracle.com>,
	linux-nfs@vger.kernel.org,
	Trond Myklebust <Trond.Myklebust@netapp.com>
Subject: Re: [PATCH 1/2] NFSv4: Fix a regression against the FreeBSD server
Date: Thu, 18 Jul 2013 19:30:55 -0400 (EDT)	[thread overview]
Message-ID: <1774242197.1390191.1374190255822.JavaMail.root@uoguelph.ca> (raw)
In-Reply-To: <CAHsu+b_FuHaa9LG1vRv1d5LwA5Ue_Ss2eoJsKEC5dx-rnuApOg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1084 bytes --]

Andre Heider wrote:
> On Wed, Jul 17, 2013 at 11:59 PM, Trond Myklebust
> <Trond.Myklebust@netapp.com> 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@netapp.com>
> 
> Tested-by: Andre Heider <a.heider@gmail.com>
> 
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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: big-attrbits.patch --]
[-- Type: text/x-patch; name=big-attrbits.patch, Size: 976 bytes --]

--- 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:

  reply	other threads:[~2013-07-18 23:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17 21:59 [PATCH 1/2] NFSv4: Fix a regression against the FreeBSD server Trond Myklebust
2013-07-17 21:59 ` [PATCH 2/2] NFSv4: encode_attrs should not backfill the bitmap and attribute length Trond Myklebust
2013-07-18 14:56   ` Andre Heider
2013-07-23 15:59   ` Andre Heider
2013-07-23 17:00     ` Myklebust, Trond
2013-07-23 17:30       ` Andre Heider
2013-07-23 20:14       ` Chuck Lever
2013-07-23 21:19         ` Myklebust, Trond
2013-07-23 21:22           ` Chuck Lever
2013-07-17 22:25 ` [PATCH 1/2] NFSv4: Fix a regression against the FreeBSD server Rick Macklem
2013-07-18 14:55 ` Andre Heider
2013-07-18 23:30   ` Rick Macklem [this message]
2013-07-18 23:48     ` Myklebust, Trond
2013-07-20  8:48     ` Andre Heider

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1774242197.1390191.1374190255822.JavaMail.root@uoguelph.ca \
    --to=rmacklem@uoguelph.ca \
    --cc=Trond.Myklebust@netapp.com \
    --cc=a.heider@gmail.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).