dect
/
linux-2.6
Archived
13
0
Fork 0

Btrfs: fix off-by-one in lseek

Lock end is inclusive.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
This commit is contained in:
Liu Bo 2013-01-07 03:53:08 +00:00 committed by Josef Bacik
parent 3268a2468e
commit 1214b53f90
1 changed files with 1 additions and 0 deletions

View File

@ -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);