[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-fsdevel
Subject:    Re: Can this happen ?
From:       Andrew Morton <akpm () osdl ! org>
Date:       2005-04-28 0:05:15
Message-ID: 20050427170515.54a67065.akpm () osdl ! org
[Download RAW message or body]

Badari Pulavarty <pbadari@us.ibm.com> wrote:
>
> We ran into a panic in drop_buffers()

erk.



In rare situations, drop_buffers() can be called for a page which has buffers,
but no ->mapping (it was truncated, but the buffers were left behind because
ext3 was still fiddling with them).

But if there was an I/O error in a buffer_head, drop_buffers() will try to get
at the address_space and will oops.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 fs/buffer.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/buffer.c~drop-buffers-oops-fix fs/buffer.c
--- 25/fs/buffer.c~drop-buffers-oops-fix	Wed Apr 27 17:02:02 2005
+++ 25-akpm/fs/buffer.c	Wed Apr 27 17:02:44 2005
@@ -2924,7 +2924,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;
_

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic