All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
Cc: Andre Heider <a.heider@gmail.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 16:14:03 -0400	[thread overview]
Message-ID: <A4648039-314B-4B30-BCDC-7D612DE1EC1F@oracle.com> (raw)
In-Reply-To: <1374598847.12943.0.camel@leira.trondhjem.org>


On Jul 23, 2013, at 1:00 PM, "Myklebust, Trond" <Trond.Myklebust@netapp.com> wrote:

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

Even with this patch applied, cthon basic tests fail immediately for me.  The mkdir to create the test directory fails with EIO.

The wire trace shows that the CREATE operation is malformed: the client sends a length of 8 for the 4-octet mode attribute value at the end of the operation.

This causes the server to skip over the following GETFH operation -- it thinks the client has sent 3 operations, when the client told it to expect 4 in this compound.

Here:

1064         *p++ = cpu_to_be32(bmval_len);
1065         q = p;
1066         /* Skip bitmap entries + attrlen */
1067         p += bmval_len + 1;

You've skipped over the 4-octet attrlen field, but here:

1125         *q++ = htonl(bmval0);
1126         *q++ = htonl(bmval1);
1127         if (bmval_len == 3)
1128                 *q++ = htonl(bmval2);
1129         len = (char *)p - (char *)q;
1130         *q = htonl(len);

have you failed to take the attrlen field into account when computing the length of the attribute values?

-- 
Chuck Lever
chuck[dot]lever[at]oracle[dot]com





  parent reply	other threads:[~2013-07-23 20:14 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 [this message]
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=A4648039-314B-4B30-BCDC-7D612DE1EC1F@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=a.heider@gmail.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.