linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NFSv4: Fix attribute length
@ 2013-07-24 14:14 J. Bruce Fields
  2013-07-24 14:30 ` Myklebust, Trond
  0 siblings, 1 reply; 5+ messages in thread
From: J. Bruce Fields @ 2013-07-24 14:14 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs

From: "J. Bruce Fields" <bfields@redhat.com>

The calculation of attribute length fields is too high by four because
it incorrectly includes the length field itself.

This regression was introduced by
b4a2cf76ab7c08628c62b2062dacefa496b59dfd "NFSv4: Fix a regression
against the FreeBSD server" and causes OPENs to the Linux NFS server to
fail with BADXDR errors (translated by the client into EIO).

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 fs/nfs/nfs4xdr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

I thought you guys had automated testing against the Linux server?  How
did this slip through into upstream?

--b.

diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index c74d616..d6d6754 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -1118,7 +1118,7 @@ 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);
+	len = (char *)p - (char *)q - (bmval_len + 1 << 2);
 	*q++ = htonl(bmval0);
 	*q++ = htonl(bmval1);
 	if (bmval_len == 3)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-07-24 14:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-24 14:14 [PATCH] NFSv4: Fix attribute length J. Bruce Fields
2013-07-24 14:30 ` Myklebust, Trond
2013-07-24 14:38   ` J. Bruce Fields
2013-07-24 14:41     ` Myklebust, Trond
2013-07-24 14:44       ` J. Bruce Fields

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).