summaryrefslogtreecommitdiffstats
path: root/fs/buffer.c
diff options
context:
space:
mode:
authorakpm@osdl.org <akpm@osdl.org>2005-05-01 08:58:39 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-01 08:58:39 -0700
commitde7d5a3b6c9ff8429bf046c36b56d3192b75c3da (patch)
treeb7aae262a2e790bc736fa16534b3b2d7c9e51245 /fs/buffer.c
parent552fca4cbe552520d85b21e839f289c880fa48d2 (diff)
downloadop-kernel-dev-de7d5a3b6c9ff8429bf046c36b56d3192b75c3da.zip
op-kernel-dev-de7d5a3b6c9ff8429bf046c36b56d3192b75c3da.tar.gz
[PATCH] drop_buffers() oops fix
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> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 3b12cf94..665db84 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2917,7 +2917,7 @@ drop_buffers(struct page *page, struct buffer_head **buffers_to_free)
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;
OpenPOWER on IntegriCloud