linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Badari Pulavarty <pbadari@us.ibm.com>
To: linux-mm@kvack.org, linux-fsdevel <linux-fsdevel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>, skodati@in.ibm.com
Subject: Can this happen ?
Date: 27 Apr 2005 16:38:34 -0700	[thread overview]
Message-ID: <1114645113.26913.662.camel@dyn318077bld.beaverton.ibm.com> (raw)

Hi Andrew,

We ran into a panic in drop_buffers() while running some networking
tests and I am wondering if this a valid case. try_to_free_buffers()
seems to call drop_buffers() even if the mapping is NULL. drop_buffers()
seems to de-ref the mapping. This is causing NULL pointer deref.

But, is "mapping == NULL" still valid case here ? Can we be in the
code to drop buffers and have mapping NULL ? We would be in this
code only if PagePrivate() is set. Can we have page private with
out a valid mapping ?

Thanks,
Badari

int try_to_free_buffers(struct page *page)
{
        struct address_space * const mapping = page->mapping;
        ....
                                                                                                                       
        if (mapping == NULL) {          /* can this still happen? */
                ret = drop_buffers(page, &buffers_to_free);
                goto out;
        }
}

drop_buffers(struct page *page, struct buffer_head **buffers_to_free)
{
        ....
                if (buffer_write_io_error(bh))
                        set_bit(AS_EIO, &page->mapping->flags); <<<<<<
	...
}

1:mon> e
cpu 0x1: Vector: 300 (Data Access) at [c00000007ff4b620]
    pc: c0000000000bd524: .drop_buffers+0x40/0xcc
    lr: c0000000000bd614: .try_to_free_buffers+0x64/0xf4
    sp: c00000007ff4b8a0
   msr: 8000000000009032
   dar: 60
 dsisr: 40000000
  current = 0xc00000000fe7e040
  paca    = 0xc0000000003da800
    pid   = 40, comm = kswapd1

1:mon> t
[c00000007ff4b920] c0000000000bd614 .try_to_free_buffers+0x64/0xf4
[c00000007ff4b9c0] c0000000000baadc .try_to_release_page+0x88/0x9c
[c00000007ff4ba40] c000000000099418 .shrink_list+0x3a0/0x608
[c00000007ff4bb90] c000000000099a04 .shrink_cache+0x384/0x610
[c00000007ff4bcd0] c00000000009a4d4 .shrink_zone+0x104/0x140
[c00000007ff4bd70] c00000000009aaf0 .balance_pgdat+0x270/0x448
[c00000007ff4be90] c00000000009ade4 .kswapd+0x11c/0x120
[c00000007ff4bf90] c000000000018ad0 .kernel_thread+0x4c/0x6c



--
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-27 23:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-27 23:38 Badari Pulavarty [this message]
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
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=1114645113.26913.662.camel@dyn318077bld.beaverton.ibm.com \
    --to=pbadari@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-fsdevel@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