All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
To: Andre Heider <a.heider@gmail.com>
Cc: Chuck Lever <chuck.lever@oracle.com>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	Rick Macklem <rmacklem@uoguelph.ca>
Subject: Re: [PATCH 2/2] NFSv4: encode_attrs should not backfill the bitmap and attribute length
Date: Tue, 23 Jul 2013 17:00:46 +0000	[thread overview]
Message-ID: <1374598847.12943.0.camel@leira.trondhjem.org> (raw)
In-Reply-To: <CAHsu+b-b=-pQ4f8AfHHDaPpAK3YvHomS3X-QuEJkzbAsuJBYfg@mail.gmail.com>

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

On Tue, 2013-07-23 at 17:59 +0200, Andre Heider wrote:
> Trond,
> 
> On Wed, Jul 17, 2013 at 11:59 PM, Trond Myklebust
> <Trond.Myklebust@netapp.com> wrote:
> > The attribute length is already calculated in advance. There is no
> > reason why we cannot calculate the bitmap in advance too so that
> > we don't have to play pointer games.
> 
> I'm sorry to report that this patch seems to be more than just a cleanup.
> 
> I just tested 3.11-rc2 against my FreeBSD server, and with just patch
> 1/2 (as in -rc2) I still get the failure upon `touch`. It fails with
> or without Rick's server patch.
> 
> Applying this one on top of -rc2 fixes it.

How about the attached instead of the cleanup?

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-NFSv4-Fix-brainfart-in-attribute-length-calculation.patch --]
[-- Type: text/x-patch; name="0001-NFSv4-Fix-brainfart-in-attribute-length-calculation.patch", Size: 963 bytes --]

From bd00a23bba91f54ab45e8788a8306733d8ca3062 Mon Sep 17 00:00:00 2001
From: Trond Myklebust <Trond.Myklebust@netapp.com>
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@netapp.com>
---
 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


  reply	other threads:[~2013-07-23 17:00 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 [this message]
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
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=1374598847.12943.0.camel@leira.trondhjem.org \
    --to=trond.myklebust@netapp.com \
    --cc=a.heider@gmail.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=rmacklem@uoguelph.ca \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.