ocfs2: harden buffer check during mapping of page blocks
authorMark Fasheh <mark.fasheh@oracle.com>
Mon, 18 Jun 2007 18:12:36 +0000 (11:12 -0700)
committerMark Fasheh <mark.fasheh@oracle.com>
Wed, 11 Jul 2007 00:31:52 +0000 (17:31 -0700)
We don't want to submit buffer_new blocks for read i/o. This actually won't
happen right now because those requests during an allocating write are all nicely
aligned. It's probably a good idea to provide an explicit check though.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
fs/ocfs2/aops.c

index b8869fd0884f595f4f9d36e82f7f042f146b817a..e8d16ae12ef0342c5c2e4e52cfff874d6c49c957 100644 (file)
@@ -712,7 +712,8 @@ int ocfs2_map_page_blocks(struct page *page, u64 *p_blkno,
                        if (!buffer_uptodate(bh))
                                set_buffer_uptodate(bh);
                } else if (!buffer_uptodate(bh) && !buffer_delay(bh) &&
-                    (block_start < from || block_end > to)) {
+                          !buffer_new(bh) &&
+                          (block_start < from || block_end > to)) {
                        ll_rw_block(READ, 1, &bh);
                        *wait_bh++=bh;
                }