]> git.neil.brown.name Git - history.git/commitdiff
[XFS] Fix a possible data loss issue after an unaligned unwritten
authorNathan Scott <nathans@sgi.com>
Thu, 19 Aug 2004 20:25:07 +0000 (06:25 +1000)
committerNathan Scott <nathans@lips.borg.umn.edu>
Thu, 19 Aug 2004 20:25:07 +0000 (06:25 +1000)
extent write.

SGI Modid: xfs-linux:xfs-kern:174810a
Signed-off-by: Nathan Scott <nathans@sgi.com>
fs/xfs/xfs_iomap.c

index 536556b5686f405e01ffc42e4741af3dc3540a9d..05d0610ab5a279f09fd9660c829ab81da627dcd6 100644 (file)
@@ -868,7 +868,8 @@ xfs_iomap_write_unwritten(
                                &ip->i_iocore, offset, count);
 
        offset_fsb = XFS_B_TO_FSBT(mp, offset);
-       count_fsb = XFS_B_TO_FSB(mp, count);
+       count_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)offset + count);
+       count_fsb = (xfs_filblks_t)(count_fsb - offset_fsb);
 
        do {
                nres = XFS_DIOSTRAT_SPACE_RES(mp, 0);