linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Nick Piggin <npiggin@suse.de>,
	Ravikiran G Thirumalai <kiran@scalex86.org>,
	Sage Weil <sage@newdream.net>,
	linux-fsdevel@vger.kernel.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	stable@kernel.org
Subject: Re: [patch] mm: close page_mkwrite races (try 3)
Date: Wed, 29 Apr 2009 12:45:14 -0400	[thread overview]
Message-ID: <1241023514.12464.2.camel@heimdal.trondhjem.org> (raw)
In-Reply-To: <20090429082733.f69b45c1.akpm@linux-foundation.org>

On Wed, 2009-04-29 at 08:27 -0700, Andrew Morton wrote:
> I don't know what the "NFS 3 liner" is, but I trust you'll take care of
> it.

It's this one. I can send it on to Linus as soon as Nick's stuff is
upstream unless you'd prefer to fold it in with his patch.

Cheers
  Trond
---------------------------------------------------------------------
>From f0258852dcb43c748854d2ee550c9c270bb25f21 Mon Sep 17 00:00:00 2001
From: Trond Myklebust <Trond.Myklebust@netapp.com>
Date: Fri, 24 Apr 2009 17:32:22 -0400
Subject: [PATCH] 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.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---
 fs/nfs/file.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 5a97bcf..ec7e27d 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -517,10 +517,10 @@ static int nfs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
 
 	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 = {
-- 
1.6.0.6




  reply	other threads:[~2009-04-29 16:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14  7:11 [patch] mm: close page_mkwrite races (try 2) Nick Piggin
2009-04-15  8:25 ` [patch] mm: close page_mkwrite races (try 3) Nick Piggin
2009-04-16  1:38   ` Andrew Morton
2009-04-16  2:03     ` Nick Piggin
2009-04-16  2:23     ` Nick Piggin
2009-04-28 18:57     ` Ravikiran G Thirumalai
2009-04-29  7:12       ` Nick Piggin
2009-04-29  7:24         ` Andrew Morton
2009-04-29  7:45           ` Nick Piggin
2009-04-29 12:39             ` Trond Myklebust
2009-04-29 15:27               ` Andrew Morton
2009-04-29 16:45                 ` Trond Myklebust [this message]
2009-04-30 14:22                   ` Rince
2009-04-30 14:33                     ` Rince
2009-05-02 22:12                       ` Rince
2009-05-03  1:38                         ` Trond Myklebust

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=1241023514.12464.2.camel@heimdal.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=akpm@linux-foundation.org \
    --cc=kiran@scalex86.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@suse.de \
    --cc=sage@newdream.net \
    --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 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).