Skip to content

Commit

Permalink
Btrfs: fix off-by-one in lseek
Browse files Browse the repository at this point in the history
Lock end is inclusive.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
  • Loading branch information
Liu Bo authored and Josef Bacik committed Jan 14, 2013
1 parent 3268a24 commit 1214b53
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -2242,6 +2242,7 @@ static int find_desired_extent(struct inode *inode, loff_t *offset, int origin)
if (lockend <= lockstart)
lockend = lockstart + root->sectorsize;

lockend--;
len = lockend - lockstart + 1;

len = max_t(u64, len, root->sectorsize);
Expand Down

0 comments on commit 1214b53

Please sign in to comment.