linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Arnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Cc: linux-nfs@vger.kernel.org
Subject: Re: Empty core dumps on NFSv4 mounts
Date: Fri, 02 Jul 2010 09:03:24 -0400	[thread overview]
Message-ID: <1278075804.3258.20.camel@heimdal.trondhjem.org> (raw)
In-Reply-To: <wwezkyas466.fsf@powwow.iut-bm.univ-fcomte.fr>

On Fri, 2010-07-02 at 10:01 +0200, Arnaud Giersch wrote:
> Hi,
> 
> On NFSv4 mounts, many core dumps are empty, although ulimit -c is
> unlimited.  An ls command shortly after the core dump often shows
> 4294967294 (2^32-2) as UID and GID for the "core" file.
> 
> This only happens when there was no "core" file before the dump.  If a
> "core" file owned by the current user is already present, it is
> correctly filled.
> 
> After having done a git bisect, it seems that the problem was
> introduced by commit 80e52aced138bb41b045a8595a87510f27d8d8c5
> (NFSv4: Don't do idmapper upcalls for asynchronous RPC calls).
> 
> If I understand correctly what happens, do_coredump() [fs/exec.c] fails
> because (inode->i_uid != current_fsuid()).  In fact inode->i_uid equals
> -2, because decode_attr_owner() [fs/nfs/nfs4xdr.c], which is called from
> nfs4_xdr_dec_open() via decode_getfattr(), returns without calling
> nfs_map_to_uid(), since its may_sleep parameter is false.
> 
> I however do not clearly understand what the aforementioned commit is
> supposed to fix.  I read the linux-nfs mailing list archive, and tried
> some google search, but I didn't find anything.

rpciod threads should never do anything that can cause them to sleep.
Doing an upcall as part of an XDR decode is therefore verboten.

We should ideally rather be saving the owner/group strings and doing the
upcall after the XDR is done. While that wasn't feasible when 'fattr'
structs were being allocated on the stack, now that they are dynamically
allocated, maybe we can rethink that...

Cheers
  Trond


  reply	other threads:[~2010-07-02 13:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-02  8:01 Empty core dumps on NFSv4 mounts Arnaud Giersch
2010-07-02 13:03 ` Trond Myklebust [this message]
2010-07-05 13:28   ` [PATCH/RFC 2.6.35-rc4] NFSv4: Don't do idmapper upcalls during XDR decode Arnaud Giersch
2010-08-12 10:15     ` [PATCH 2.6.35] " Arnaud Giersch
2010-09-21 11:17       ` [PATCH resend] " Arnaud Giersch
  -- strict thread matches above, loose matches on Subject: below --
2011-12-05 20:09 Empty core dumps on NFSv4 mounts Chuck Lever
2011-12-05 20:14 ` Myklebust, Trond
2011-12-05 20:19   ` Chuck Lever
2011-12-05 20:21     ` Myklebust, Trond

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=1278075804.3258.20.camel@heimdal.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=arnaud.giersch@iut-bm.univ-fcomte.fr \
    --cc=linux-nfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).