]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/xfs/xfs_bmap_util.c
Merge tag 'vfio-v5.4-rc5' of git://github.com/awilliam/linux-vfio
[linux.git] / fs / xfs / xfs_bmap_util.c
index 0910cb75b65d77b356d1cde4f38662d48a7d9367..4f443703065e3319db345d88d02f9701ba8a249c 100644 (file)
@@ -864,6 +864,7 @@ xfs_alloc_file_space(
        xfs_filblks_t           allocatesize_fsb;
        xfs_extlen_t            extsz, temp;
        xfs_fileoff_t           startoffset_fsb;
+       xfs_fileoff_t           endoffset_fsb;
        int                     nimaps;
        int                     quota_flag;
        int                     rt;
@@ -891,7 +892,8 @@ xfs_alloc_file_space(
        imapp = &imaps[0];
        nimaps = 1;
        startoffset_fsb = XFS_B_TO_FSBT(mp, offset);
-       allocatesize_fsb = XFS_B_TO_FSB(mp, count);
+       endoffset_fsb = XFS_B_TO_FSB(mp, offset + count);
+       allocatesize_fsb = endoffset_fsb - startoffset_fsb;
 
        /*
         * Allocate file space until done or until there is an error