Commit 32b5fa26 authored by Andrew Morton's avatar Andrew Morton Committed by Ben Collins

[PATCH] ext3: fix for blocksize < PAGE_CACHE_SIZE

If a buffer_head is outside i_size, block_write_full_page() will leave it
!buffer_mapped().  We shouldn't attach that buffer to the transaction for
writeout!

This bug has been in 2.5 for some time.
parent 18783bfd
......@@ -1262,6 +1262,13 @@ static int bput_one(handle_t *handle, struct buffer_head *bh)
return 0;
}
static int journal_dirty_data_fn(handle_t *handle, struct buffer_head *bh)
{
if (buffer_mapped(bh))
return ext3_journal_dirty_data(handle, bh);
return 0;
}
/*
* Note that we always start a transaction even if we're not journalling
* data. This is to preserve ordering: any hole instantiation within
......@@ -1381,7 +1388,7 @@ static int ext3_writepage(struct page *page, struct writeback_control *wbc)
if (ret == 0) {
err = walk_page_buffers(handle, page_bufs,
0, PAGE_CACHE_SIZE, NULL,
ext3_journal_dirty_data);
journal_dirty_data_fn);
if (!ret)
ret = err;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment