aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorLiu Bo <bo.li.liu@oracle.com>2013-05-01 12:23:41 -0400
committerJosef Bacik <jbacik@fusionio.com>2013-05-17 16:27:26 -0400
commita52f4cd2b1a863a42c1cb268b1cddad451cdfede (patch)
tree5b54a8cbf8537fef67adb8d5b9a5b52783bc37ee /fs/btrfs
parent60b62978bc5e903cd487de34972fb30f76c74a2e (diff)
Btrfs: fix off-by-one in fiemap
lock_extent/unlock_extent expect an exclusive end. Tested-by: David Sterba <dsterba@suse.cz> Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/extent_io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index d2ac518f90e4..3e6e410002e5 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3989,7 +3989,7 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
3989 last_for_get_extent = isize; 3989 last_for_get_extent = isize;
3990 } 3990 }
3991 3991
3992 lock_extent_bits(&BTRFS_I(inode)->io_tree, start, start + len, 0, 3992 lock_extent_bits(&BTRFS_I(inode)->io_tree, start, start + len - 1, 0,
3993 &cached_state); 3993 &cached_state);
3994 3994
3995 em = get_extent_skip_holes(inode, start, last_for_get_extent, 3995 em = get_extent_skip_holes(inode, start, last_for_get_extent,
@@ -4076,7 +4076,7 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
4076out_free: 4076out_free:
4077 free_extent_map(em); 4077 free_extent_map(em);
4078out: 4078out:
4079 unlock_extent_cached(&BTRFS_I(inode)->io_tree, start, start + len, 4079 unlock_extent_cached(&BTRFS_I(inode)->io_tree, start, start + len - 1,
4080 &cached_state, GFP_NOFS); 4080 &cached_state, GFP_NOFS);
4081 return ret; 4081 return ret;
4082} 4082}