Here's a possible patch that fixes this oops.
There's one case if a page was read over a "hole"
then no buffers are attached to it. In this case,
buffers are only allocated as part of prepare_write.
ananth.
--------------------------------------------------------------------------
Rajagopal Ananthanarayanan ("ananth")
Member Technical Staff, SGI.
----------------------------------------------------------------------------- ../../xfs-orig/linux/fs/pagebuf/page_buf_io.c Thu Mar 1 16:54:40 2001
+++ fs/pagebuf/page_buf_io.c Thu Mar 1 16:56:24 2001
@@ -1036,7 +1036,6 @@
STATIC int pagebuf_write_full_page(struct page *page)
{
struct inode *inode = (struct inode*)page->mapping->host;
- struct buffer_head *bh = page->buffers;
unsigned long end_index = inode->i_size >> PAGE_CACHE_SHIFT;
loff_t offset;
int err, pb_flags;
@@ -1064,8 +1063,16 @@
if (err) {
ClearPageUptodate(page);
} else {
+ struct buffer_head *bh;
+
__pb_block_commit_write_async(inode, page, NULL, 0);
+ /*
+ * Pages over holes may have just been allocated
+ * buffers, so bh needs to be looked up now.
+ */
+ bh = page->buffers;
+
/*
* Kick-start that last write...
*/
|