Btrfs: fix off-by-one in lseek
authorLiu Bo <bo.li.liu@oracle.com>
Mon, 7 Jan 2013 03:53:08 +0000 (03:53 +0000)
committerJosef Bacik <josef@toxicpanda.com>
Mon, 14 Jan 2013 18:53:22 +0000 (13:53 -0500)
Lock end is inclusive.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/file.c

index 20452c110d7d4e1ce96db6b6af2f4c797c2c1e63..fa48051484b87192f3d4e14dce90deb40e90f9e6 100644 (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);