Btrfs: Fix typo in extent_io.c
authorYan <yanzheng@21cn.com>
Mon, 4 Feb 2008 13:57:25 +0000 (08:57 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 25 Sep 2008 15:04:00 +0000 (11:04 -0400)
---

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/extent_io.c
fs/btrfs/inode.c

index 5d2fb527fd960128c5e7011dffe20bb02eb6da56..36a943e51808e1a18b7839de2a520257f914539c 100644 (file)
@@ -1416,7 +1416,7 @@ static int end_bio_extent_writepage(struct bio *bio,
                 * to the correct offsets in the file
                 */
                if (state && (state->end + 1 != start ||
-                   !state->state & EXTENT_WRITEBACK)) {
+                   !(state->state & EXTENT_WRITEBACK))) {
                        state = NULL;
                }
                spin_unlock_irqrestore(&tree->lock, flags);
@@ -1539,7 +1539,7 @@ static int end_bio_extent_readpage(struct bio *bio,
                 * to the correct offsets in the file
                 */
                if (state && (state->end + 1 != start ||
-                   !state->state & EXTENT_WRITEBACK)) {
+                   !(state->state & EXTENT_LOCKED))) {
                        state = NULL;
                }
                spin_unlock_irqrestore(&tree->lock, flags);
index f13b1dbc06199a028bf09939101713a2456e3a8e..44fc94fee2c4ca3e2b5738ddef355c460c796e19 100644 (file)
@@ -364,8 +364,7 @@ int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end,
        if (btrfs_test_opt(root, NODATASUM) ||
            btrfs_test_flag(inode, NODATASUM))
                return 0;
-
-       if (state->start == start) {
+       if (state && state->start == start) {
                private = state->private;
                ret = 0;
        } else {