summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorYan2007-09-17 17:13:12 +0200
committerChris Mason2008-09-25 17:03:56 +0200
commit8e1cd766643f040fd88b9c4221353a3f6b77db1e (patch)
tree837357a686763f6a3a3559b2320daf40836d46d3 /fs
parentBtrfs: truncate: don't update inode->i_blocks when extent is a hole (diff)
downloadkernel-qcow2-linux-8e1cd766643f040fd88b9c4221353a3f6b77db1e.tar.gz
kernel-qcow2-linux-8e1cd766643f040fd88b9c4221353a3f6b77db1e.tar.xz
kernel-qcow2-linux-8e1cd766643f040fd88b9c4221353a3f6b77db1e.zip
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/inode.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 43bf4337859c..88b3ef20be69 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -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);