aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2005-09-02 02:41:32 -0400
committerNathan Scott <nathans@sgi.com>2005-09-02 02:41:32 -0400
commitd52b44d07a43b723ac2fbf1bf4053031f723676c (patch)
tree10b39fa2358be3766f36a6f7729d176ceb14ebd6
parentad4a8ac4e9d9cffb0a4c9ebebc6bda9d8dbbfe99 (diff)
[XFS] Fix regression in transaction reserved-block accounting for direct
writes. SGI-PV: 938145 SGI-Modid: xfs-linux:xfs-kern:23088a Signed-off-by: Nathan Scott <nathans@sgi.com>
-rw-r--r--fs/xfs/xfs_iomap.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 2edd6769e5d3..44999d557d8e 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -391,9 +391,9 @@ xfs_iomap_write_direct(
391 xfs_bmbt_irec_t imap[XFS_WRITE_IMAPS], *imapp; 391 xfs_bmbt_irec_t imap[XFS_WRITE_IMAPS], *imapp;
392 xfs_bmap_free_t free_list; 392 xfs_bmap_free_t free_list;
393 int aeof; 393 int aeof;
394 xfs_filblks_t datablocks, qblocks, resblks; 394 xfs_filblks_t qblocks, resblks;
395 int committed; 395 int committed;
396 int numrtextents; 396 int resrtextents;
397 397
398 /* 398 /*
399 * Make sure that the dquots are there. This doesn't hold 399 * Make sure that the dquots are there. This doesn't hold
@@ -434,14 +434,14 @@ xfs_iomap_write_direct(
434 434
435 if (!(extsz = ip->i_d.di_extsize)) 435 if (!(extsz = ip->i_d.di_extsize))
436 extsz = mp->m_sb.sb_rextsize; 436 extsz = mp->m_sb.sb_rextsize;
437 numrtextents = qblocks = (count_fsb + extsz - 1); 437 resrtextents = qblocks = (count_fsb + extsz - 1);
438 do_div(numrtextents, mp->m_sb.sb_rextsize); 438 do_div(resrtextents, mp->m_sb.sb_rextsize);
439 resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0);
439 quota_flag = XFS_QMOPT_RES_RTBLKS; 440 quota_flag = XFS_QMOPT_RES_RTBLKS;
440 datablocks = 0;
441 } else { 441 } else {
442 datablocks = qblocks = count_fsb; 442 resrtextents = 0;
443 resblks = qblocks = XFS_DIOSTRAT_SPACE_RES(mp, count_fsb);
443 quota_flag = XFS_QMOPT_RES_REGBLKS; 444 quota_flag = XFS_QMOPT_RES_REGBLKS;
444 numrtextents = 0;
445 } 445 }
446 446
447 /* 447 /*
@@ -449,9 +449,8 @@ xfs_iomap_write_direct(
449 */ 449 */
450 xfs_iunlock(ip, XFS_ILOCK_EXCL); 450 xfs_iunlock(ip, XFS_ILOCK_EXCL);
451 tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT); 451 tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT);
452 resblks = XFS_DIOSTRAT_SPACE_RES(mp, datablocks);
453 error = xfs_trans_reserve(tp, resblks, 452 error = xfs_trans_reserve(tp, resblks,
454 XFS_WRITE_LOG_RES(mp), numrtextents, 453 XFS_WRITE_LOG_RES(mp), resrtextents,
455 XFS_TRANS_PERM_LOG_RES, 454 XFS_TRANS_PERM_LOG_RES,
456 XFS_WRITE_LOG_COUNT); 455 XFS_WRITE_LOG_COUNT);
457 456