linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Badari Pulavarty <pbadari@us.ibm.com>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: linux-mm@kvack.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>,
	skodati@in.ibm.com
Subject: Re: [PATCH] drop_buffers() shouldn't de-ref page->mapping if its NULL
Date: 28 Apr 2005 08:12:34 -0700	[thread overview]
Message-ID: <1114701153.26913.679.camel@dyn318077bld.beaverton.ibm.com> (raw)
In-Reply-To: <87k6mn5zs6.fsf@devron.myhome.or.jp>

On Wed, 2005-04-27 at 20:46, OGAWA Hirofumi wrote:
> Badari Pulavarty <pbadari@us.ibm.com> writes:
> 
> > Hi,
> >
> > I answered my own question. It looks like we could have pages
> > with buffers without page->mapping. In such cases, we shouldn't
> > de-ref page->mapping in drop_buffers(). Here is the trivial
> > patch to fix it.
> >
> > Thanks,
> > Badari
> 
> [...]
> 
> >
> > Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
> > --- linux-2.6.12-rc2.org/fs/buffer.c	2005-04-27 07:19:44.000000000 -0700
> > +++ linux-2.6.12-rc2/fs/buffer.c	2005-04-27 07:20:34.000000000 -0700
> > @@ -2917,7 +2917,7 @@ drop_buffers(struct page *page, struct b
> >  
> >  	bh = head;
> >  	do {
> > -		if (buffer_write_io_error(bh))
> > +		if (buffer_write_io_error(bh) && page->mapping)
> >  			set_bit(AS_EIO, &page->mapping->flags);
> >  		if (buffer_busy(bh))
> >  			goto failed;
> 
> On my experience, this happened the bh leak case only.


Could you explain more on bh leak ? Is there one in the current code ?

> 
> If you are not sure whether this is valid state or not, I worry this
> patch hides real bug.  How about adding the warning, not just remove
> de-ref?

Andrew confirmed that this is a valid case.

I don't understand what you want to do here ? If the mapping is NULL,
we can't de-ref it.  Whats the point in putting a warning and de-refing
it. Its going to cause NULL pointer de-ref anyway.

Thanks,
Badari

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  reply	other threads:[~2005-04-28 15:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-27 23:38 Can this happen ? Badari Pulavarty
2005-04-27 23:53 ` [PATCH] drop_buffers() shouldn't de-ref page->mapping if its NULL Badari Pulavarty
2005-04-28  3:46   ` OGAWA Hirofumi
2005-04-28 15:12     ` Badari Pulavarty [this message]
2005-04-28 16:26       ` OGAWA Hirofumi
2005-04-28  0:05 ` Can this happen ? Andrew Morton

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=1114701153.26913.679.camel@dyn318077bld.beaverton.ibm.com \
    --to=pbadari@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=skodati@in.ibm.com \
    /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