mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Mason <mason@suse.com>
To: Jens Axboe <axboe@suse.de>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, kenneth.w.chen@intel.com
Subject: Re: [PATCH] per-backing dev unplugging #2
Date: Fri, 12 Mar 2004 15:34:07 -0500	[thread overview]
Message-ID: <1079123647.4186.211.camel@watt.suse.com> (raw)
In-Reply-To: <20040312200253.GA16880@suse.de>

On Fri, 2004-03-12 at 15:02, Jens Axboe wrote:
> On Fri, Mar 12 2004, Andrew Morton wrote:
> > Chris Mason <mason@suse.com> wrote:
> > >
> > > During a mixed load test including fsx-linux and a bunch of procs
> > > running cp/read/rm loops, I got a null pointer deref with the call
> > > trace:
> > > 
> > > __lock_page->sync_page->block_sync_page
> > > 
> > > I don't see how we can trust page->mapping in this path, can't it
> > > disappear?  If so, it would be a bug without Jens' patch too, just
> > > harder to hit.

Here's my guess, it took a few hours to trigger the first time, so it'll
be a while before I can say if it makes a difference.  I'm not convinced
this will help, but it's all I can think of so far...

-chris

Index: linux.t/fs/buffer.c
===================================================================
--- linux.t.orig/fs/buffer.c	2004-03-12 13:13:45.000000000 -0500
+++ linux.t/fs/buffer.c	2004-03-12 15:21:44.635262192 -0500
@@ -2939,7 +2939,10 @@ EXPORT_SYMBOL(try_to_free_buffers);
 
 int block_sync_page(struct page *page)
 {
-	blk_run_address_space(page->mapping);
+	struct address_space *mapping;
+	smp_mb();
+	mapping = page->mapping;
+	blk_run_address_space(mapping);
 	return 0;
 }
 
Index: linux.t/mm/filemap.c
===================================================================
--- linux.t.orig/mm/filemap.c	2004-03-12 13:13:45.000000000 -0500
+++ linux.t/mm/filemap.c	2004-03-12 15:23:00.216089824 -0500
@@ -121,8 +121,10 @@ void remove_from_page_cache(struct page 
 
 static inline int sync_page(struct page *page)
 {
-	struct address_space *mapping = page->mapping;
-
+	struct address_space *mapping;
+	
+	smp_mb();
+	mapping = page->mapping;
 	if (mapping && mapping->a_ops && mapping->a_ops->sync_page)
 		return mapping->a_ops->sync_page(page);
 	return 0;



  reply	other threads:[~2004-03-12 20:39 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-11  8:36 Jens Axboe
2004-03-11 22:44 ` Nathan Scott
2004-03-12  1:23 ` William Lee Irwin III
2004-03-12  6:41 ` Ingo Oeser
2004-03-12  8:04   ` Jens Axboe
2004-03-12 19:51 ` Chris Mason
2004-03-12 20:03   ` Andrew Morton
2004-03-12 20:02     ` Jens Axboe
2004-03-12 20:34       ` Chris Mason [this message]
2004-03-12 20:34         ` Jens Axboe
2004-03-12 20:41           ` Chris Mason
2004-03-12 20:51             ` Jens Axboe
2004-03-14 20:43               ` Chris Mason
2004-03-14 20:47                 ` Jens Axboe
2004-03-14 20:57                   ` Chris Mason
2004-03-14 21:04                   ` Andrew Morton
2004-03-14 21:09                     ` Jens Axboe
2004-03-15 21:58                       ` Chris Mason
2004-03-12 20:06     ` Chris Mason
2004-03-16  5:22 Jeremy Higdon
2004-03-16  6:36 ` Nick Piggin
2004-03-16  7:20   ` Jeremy Higdon
2004-03-16  7:38     ` Jens Axboe
2004-03-17  0:23       ` Jeremy Higdon
2004-03-16  7:46     ` Nick Piggin
2004-03-16  7:29 ` Jens Axboe
2004-03-16 17:20 ` Jesse Barnes

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=1079123647.4186.211.camel@watt.suse.com \
    --to=mason@suse.com \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=kenneth.w.chen@intel.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®