linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: stable@vger.kernel.org, Rik Theys <Rik.Theys@esat.kuleuven.be>,
	Trond Myklebust <Trond.Myklebust@netapp.com>,
	linux-nfs@vger.kernel.org, David Flyn <davidf@rd.bbc.co.uk>,
	Jeff Layton <jlayton@redhat.com>,
	659111@bugs.debian.org
Subject: Re: [PATCH 3.0.y, 3.2.y] NFSv4: Revalidate uid/gid after open
Date: Fri, 18 May 2012 12:31:56 -0700	[thread overview]
Message-ID: <20120518193156.GD4874@kroah.com> (raw)
In-Reply-To: <20120511092020.GD5733@burratino>

On Fri, May 11, 2012 at 04:20:20AM -0500, Jonathan Nieder wrote:
> This is a shorter (and more appropriate for stable kernels) analog to
> the following upstream commit:
> 
> commit 6926afd1925a54a13684ebe05987868890665e2b
> Author: Trond Myklebust <Trond.Myklebust@netapp.com>
> Date:   Sat Jan 7 13:22:46 2012 -0500
> 
>     NFSv4: Save the owner/group name string when doing open
> 
>     ...so that we can do the uid/gid mapping outside the asynchronous RPC
>     context.
>     This fixes a bug in the current NFSv4 atomic open code where the client
>     isn't able to determine what the true uid/gid fields of the file are,
>     (because the asynchronous nature of the OPEN call denies it the ability
>     to do an upcall) and so fills them with default values, marking the
>     inode as needing revalidation.
>     Unfortunately, in some cases, the VFS will do some additional sanity
>     checks on the file, and may override the server's decision to allow
>     the open because it sees the wrong owner/group fields.
> 
>     Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> 
> Without this patch, logging into two different machines with home
> directories mounted over NFS4 and then running "vim" and typing ":q"
> in each reliably produces the following error on the second machine:
> 
> 	E137: Viminfo file is not writable: /users/system/rtheys/.viminfo
> 
> This regression was introduced by 80e52aced138 ("NFSv4: Don't do
> idmapper upcalls for asynchronous RPC calls", merged during the 2.6.32
> cycle) --- after the OPEN call, .viminfo has the default values for
> st_uid and st_gid (0xfffffffe) cached because we do not want to let
> rpciod wait for an idmapper upcall to fill them in.
> 
> The fix used in mainline is to save the owner and group as strings and
> perform the upcall in _nfs4_proc_open outside the rpciod context,
> which takes about 600 lines.  For stable, we can do something similar
> with a one-liner: make open check for the stale fields and make a
> (synchronous) GETATTR call to fill them when needed.
> 
> Trond dictated the patch, I typed it in, and Rik tested it.
> 
> Addresses http://bugs.debian.org/659111 and
>           https://bugzilla.redhat.com/789298
> 
> Reported-by: Rik Theys <Rik.Theys@esat.kuleuven.be>
> Explained-by: David Flyn <davidf@rd.bbc.co.uk>
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
> Tested-by: Rik Theys <Rik.Theys@esat.kuleuven.be>
> ---
> Hi Ben and Greg,
> 
> Please consider this patch for inclusion in 3.0.y and 3.2.y kernels.
> 3.3.y doesn't need it since 6926afd1925a was merged during the 3.3
> merge window.

Wonderful work, now applied to the 3.0-stable tree, thanks for doing
this.

greg k-h

      parent reply	other threads:[~2012-05-18 19:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.LRH.2.00.1204242156380.28096@helium.esat.kuleuven.be>
2012-05-11  9:20 ` [PATCH 3.0.y, 3.2.y] NFSv4: Revalidate uid/gid after open Jonathan Nieder
2012-05-12  9:20   ` Ben Hutchings
2012-05-12 19:13     ` Jonathan Nieder
2012-05-18 19:31   ` Greg KH [this message]

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=20120518193156.GD4874@kroah.com \
    --to=greg@kroah.com \
    --cc=659111@bugs.debian.org \
    --cc=Rik.Theys@esat.kuleuven.be \
    --cc=Trond.Myklebust@netapp.com \
    --cc=davidf@rd.bbc.co.uk \
    --cc=jlayton@redhat.com \
    --cc=jrnieder@gmail.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=stable@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).