Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1214b53f authored by Liu Bo's avatar Liu Bo Committed by Josef Bacik
Browse files

Btrfs: fix off-by-one in lseek



Lock end is inclusive.

Signed-off-by: default avatarLiu Bo <bo.li.liu@oracle.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
parent 3268a246
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);