xfs
[Top] [All Lists]

Re: Latest XFS kupdate oops

To: Joakim Bodin <joabo552@xxxxxxxxxxxxxx>, Linux-XFS Mailing List <linux-xfs@xxxxxxxxxxx>
Subject: Re: Latest XFS kupdate oops
From: Rajagopal Ananthanarayanan <ananth@xxxxxxx>
Date: Thu, 01 Mar 2001 17:03:48 -0800
References: <3A9EE314.3020302@xxxxxxxxxxxxxx> <3A9EE937.EA684C76@xxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx
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...
                 */
<Prev in Thread] Current Thread [Next in Thread>