All of lore.kernel.org
 help / color / mirror / Atom feed
From: npiggin@suse.de
To: stable@kernel.org
Cc: linux-fsdevel@vger.kernel.org, linux-mm@vger.kernel.org
Subject: [2.6.27.stable][patch 6/6] NFS: Close page_mkwrite() races
Date: Tue, 12 May 2009 16:23:52 +1000	[thread overview]
Message-ID: <20090512070750.379544453@suse.de> (raw)
In-Reply-To: 20090512062346.554974013@suse.de

[-- Attachment #1: 7fdf523067666b0eaff330f362401ee50ce187c4 --]
[-- Type: text/plain, Size: 954 bytes --]

    NFS: Close page_mkwrite() races
    
    Follow up to Nick Piggin's patches to ensure that nfs_vm_page_mkwrite
    returns with the page lock held, and sets the VM_FAULT_LOCKED flag.
    
    See http://bugzilla.kernel.org/show_bug.cgi?id=12913
    
    Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

---
 fs/nfs/file.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6/fs/nfs/file.c
===================================================================
--- linux-2.6.orig/fs/nfs/file.c
+++ linux-2.6/fs/nfs/file.c
@@ -478,10 +478,10 @@ static int nfs_vm_page_mkwrite(struct vm
 
 	ret = nfs_updatepage(filp, page, 0, pagelen);
 out_unlock:
+	if (!ret)
+		return VM_FAULT_LOCKED;
 	unlock_page(page);
-	if (ret)
-		ret = VM_FAULT_SIGBUS;
-	return ret;
+	return VM_FAULT_SIGBUS;
 }
 
 static struct vm_operations_struct nfs_file_vm_ops = {



  parent reply	other threads:[~2009-05-12  7:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-12  6:23 [2.6.27.stable][patch 0/6] page_mkwrite fixes npiggin
2009-05-12  6:23 ` [2.6.27.stable][patch 1/6] mm: page_mkwrite change prototype to match fault npiggin
2009-05-12  6:23 ` [2.6.27.stable][patch 2/6] fs: fix page_mkwrite error cases in core code and btrfs npiggin
2009-05-12  6:23 ` [2.6.27.stable][patch 3/6] mm: close page_mkwrite races npiggin
2009-05-12  6:23 ` [2.6.27.stable][patch 4/6] GFS2: Fix page_mkwrite() return code npiggin
2009-05-12  6:23 ` [2.6.27.stable][patch 5/6] NFS: Fix the return value in nfs_page_mkwrite() npiggin
2009-05-12  6:23 ` npiggin [this message]
2009-05-12 22:07 ` [stable] [2.6.27.stable][patch 0/6] page_mkwrite fixes Greg KH

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=20090512070750.379544453@suse.de \
    --to=npiggin@suse.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@vger.kernel.org \
    --cc=stable@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 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.