Btrfs: Fix double free and off by one in inode.c
The first change removes potential double free, the second fix a off by one error. Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
bab9fb035f
commit
8e1cd76664
|
@ -206,7 +206,6 @@ void btrfs_read_locked_inode(struct inode *inode)
|
||||||
memcpy(&location, &BTRFS_I(inode)->location, sizeof(location));
|
memcpy(&location, &BTRFS_I(inode)->location, sizeof(location));
|
||||||
ret = btrfs_lookup_inode(NULL, root, path, &location, 0);
|
ret = btrfs_lookup_inode(NULL, root, path, &location, 0);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
btrfs_free_path(path);
|
|
||||||
goto make_bad;
|
goto make_bad;
|
||||||
}
|
}
|
||||||
inode_item = btrfs_item_ptr(btrfs_buffer_leaf(path->nodes[0]),
|
inode_item = btrfs_item_ptr(btrfs_buffer_leaf(path->nodes[0]),
|
||||||
|
@ -1536,7 +1535,7 @@ again:
|
||||||
flush_dcache_page(result->b_page);
|
flush_dcache_page(result->b_page);
|
||||||
kunmap(page);
|
kunmap(page);
|
||||||
set_extent_uptodate(em_tree, extent_start,
|
set_extent_uptodate(em_tree, extent_start,
|
||||||
extent_end, GFP_NOFS);
|
extent_end - 1, GFP_NOFS);
|
||||||
goto insert;
|
goto insert;
|
||||||
} else {
|
} else {
|
||||||
printk("unkknown found_type %d\n", found_type);
|
printk("unkknown found_type %d\n", found_type);
|
||||||
|
|
Loading…
Reference in New Issue