Re: Linux 3.11-rc2

From: Myklebust, Trond
Date: Tue Jul 23 2013 - 14:31:52 EST


On Mon, 2013-07-22 at 21:17 -0400, Trond Myklebust wrote:
> On Tue, 2013-07-23 at 03:04 +0200, rydberg@xxxxxxxxxxx wrote:
> > Hi Trond, Linus,
> >
> > On Sun, Jul 21, 2013 at 12:53:10PM -0700, Linus Torvalds wrote:
> > > So it's been another week, and -rc2 is out there.
> >
> > This one happens to break nfs in a rather blunt-instrument fashion -
> > creating files on a nfs4 partition [1] no longer works. Bisection
> > yields this commit as the culprit:
> >
> > commit b4a2cf76ab7c08628c62b2062dacefa496b59dfd
> > Author: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>
> > Date: Wed Jul 17 16:43:16 2013 -0400
> >
> > NFSv4: Fix a regression against the FreeBSD server
> >
> > 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>
> >
> > Reverting the patch returns things to normal.
>
> - Can you please provide me with a binary tcpdump or wireshark dump that
> demonstrates the problem?
>
> - What server is this?

OK. With Andre's help, I think we've root caused the problem. Can you
please confirm that the attached patch also solves the issue for you?

--
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@xxxxxxxxxx
www.netapp.com
From 1f84e4f9ef9fc4ff502c112df049dfa6f656f4e0 Mon Sep 17 00:00:00 2001
From: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>
Date: Tue, 23 Jul 2013 12:53:39 -0400
Subject: [PATCH] NFSv4: Fix brainfart in attribute length calculation

The calculation of the attribute length was 4 bytes off.

Signed-off-by: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>
Tested-by: Andre Heider <a.heider@xxxxxxxxx>
---
fs/nfs/nfs4xdr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index c74d616..3850b01 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -1118,11 +1118,11 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap,
len, ((char *)p - (char *)q) + 4);
BUG();
}
- len = (char *)p - (char *)q - (bmval_len << 2);
*q++ = htonl(bmval0);
*q++ = htonl(bmval1);
if (bmval_len == 3)
*q++ = htonl(bmval2);
+ len = (char *)p - (char *)(q + 1);
*q = htonl(len);

/* out: */
--
1.8.3.1