Btrfs: Fix double free and off by one in inode.c
authorYan <yanzheng@21cn.com>
Mon, 17 Sep 2007 15:13:12 +0000 (11:13 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 25 Sep 2008 15:03:56 +0000 (11:03 -0400)
The first change removes  potential double free, the second fix a off
by one error.

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

index 43bf4337859cf12ea52fa781566c539f397f301a..88b3ef20be69d230cbf5f9a5723f065c762c0ab9 100644 (file)
@@ -206,7 +206,6 @@ void btrfs_read_locked_inode(struct inode *inode)
        memcpy(&location, &BTRFS_I(inode)->location, sizeof(location));
        ret = btrfs_lookup_inode(NULL, root, path, &location, 0);
        if (ret) {
-               btrfs_free_path(path);
                goto make_bad;
        }
        inode_item = btrfs_item_ptr(btrfs_buffer_leaf(path->nodes[0]),
@@ -1536,7 +1535,7 @@ again:
                flush_dcache_page(result->b_page);
                kunmap(page);
                set_extent_uptodate(em_tree, extent_start,
-                                   extent_end, GFP_NOFS);
+                                   extent_end - 1, GFP_NOFS);
                goto insert;
        } else {
                printk("unkknown found_type %d\n", found_type);