From: Chuck Lever <Chuck.Lever@oracle.com>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Milan Broz <mbroz@redhat.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-nfs@vger.kernel.org
Subject: Re: NFS OOps - kernel BUG at fs/nfs/nfs3xdr.c:1338
Date: Tue, 18 Jan 2011 10:59:14 -0500 [thread overview]
Message-ID: <BC9E8816-B395-44C1-ACF8-FEC4E80870C1@oracle.com> (raw)
In-Reply-To: <1295048791.20016.15.camel@heimdal.trondhjem.org>
On Jan 14, 2011, at 6:46 PM, Trond Myklebust wrote:
> On Sat, 2011-01-15 at 00:18 +0100, Milan Broz wrote:
>> Hi,
>>
>> on today Linus' tree I get OOps if using nfs.
>>
>> server (2.6.36) exports dir:
>> /dir 172.16.1.0/24(rw,async,all_squash,no_subtree_check,anonuid=500,anongid=500)
>>
>> on client it is mounted in fstab
>> server:/dir /mnt/tst nfs rw,soft 0 0
>>
>> and these commands OOpses it (simplified from a configure script):
>>
>> cd /dir
>> touch x
>> install x y
>>
>> [ 105.327701] ------------[ cut here ]------------
>> [ 105.327979] kernel BUG at fs/nfs/nfs3xdr.c:1338!
>
> Chuck, why did you add those BUG_ON()s there? I know that
> nfsacl_encode() is for some unfathomable reason declared as returning an
> unsigned integer, but if you look at the actual code, you will see that
> it returns a number of negative signed error values depending on whether
> or not allocations succeeded, number of entries is valid, etc...
>
> IOW: negative values are perfectly allowable here, and should simply
> cause the rpc call to be aborted, not an Oops.
XDR encoders no longer return an error code to the generic RPC client code. The architectural assumption is that the heavy lifting (error checking, resource allocation, etc) is done by the upper layers, and that any problems that occur in the XDR routines are software bugs. This seems to be the only remaining XDR code that depends on returning an error. (I recall there may be one spot in the NFSv4 XDR code too).
We should have checked nfsacl_encode() more closely before the recent spate of XDR changes. However, this bit of layering violation has been a thorn in our side for years. Perhaps we can use the new xdr_stream scratch buffer to address the allocation failure issues here, and better error checking can be done in the upper layers.
Milan, I assume the install command is trying to set an ACL on an NFS file. Can you tell us what the ACL looks like?
--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
next prev parent reply other threads:[~2011-01-18 15:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-14 23:18 Milan Broz
2011-01-14 23:46 ` Trond Myklebust
2011-01-18 15:59 ` Chuck Lever [this message]
2011-01-18 18:15 ` Milan Broz
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=BC9E8816-B395-44C1-ACF8-FEC4E80870C1@oracle.com \
--to=chuck.lever@oracle.com \
--cc=Trond.Myklebust@netapp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=mbroz@redhat.com \
/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
all inboxes | Powered by JetHome®