mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
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:
parent
3268a2468e
commit
1214b53f90
1 changed files with 1 additions and 0 deletions
|
@ -2242,6 +2242,7 @@ static int find_desired_extent(struct inode *inode, loff_t *offset, int origin)
|
||||||
if (lockend <= lockstart)
|
if (lockend <= lockstart)
|
||||||
lockend = lockstart + root->sectorsize;
|
lockend = lockstart + root->sectorsize;
|
||||||
|
|
||||||
|
lockend--;
|
||||||
len = lockend - lockstart + 1;
|
len = lockend - lockstart + 1;
|
||||||
|
|
||||||
len = max_t(u64, len, root->sectorsize);
|
len = max_t(u64, len, root->sectorsize);
|
||||||
|
|
Loading…
Reference in a new issue