tree 10b39fa2358be3766f36a6f7729d176ceb14ebd6
parent ad4a8ac4e9d9cffb0a4c9ebebc6bda9d8dbbfe99
author Nathan Scott <[EMAIL PROTECTED]> Fri, 02 Sep 2005 16:41:32 +1000
committer Nathan Scott <[EMAIL PROTECTED]> Fri, 02 Sep 2005 16:41:32 +1000

[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 <[EMAIL PROTECTED]>

 fs/xfs/xfs_iomap.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -391,9 +391,9 @@ xfs_iomap_write_direct(
        xfs_bmbt_irec_t imap[XFS_WRITE_IMAPS], *imapp;
        xfs_bmap_free_t free_list;
        int             aeof;
-       xfs_filblks_t   datablocks, qblocks, resblks;
+       xfs_filblks_t   qblocks, resblks;
        int             committed;
-       int             numrtextents;
+       int             resrtextents;
 
        /*
         * Make sure that the dquots are there. This doesn't hold
@@ -434,14 +434,14 @@ xfs_iomap_write_direct(
 
                if (!(extsz = ip->i_d.di_extsize))
                        extsz = mp->m_sb.sb_rextsize;
-               numrtextents = qblocks = (count_fsb + extsz - 1);
-               do_div(numrtextents, mp->m_sb.sb_rextsize);
+               resrtextents = qblocks = (count_fsb + extsz - 1);
+               do_div(resrtextents, mp->m_sb.sb_rextsize);
+               resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0);
                quota_flag = XFS_QMOPT_RES_RTBLKS;
-               datablocks = 0;
        } else {
-               datablocks = qblocks = count_fsb;
+               resrtextents = 0;
+               resblks = qblocks = XFS_DIOSTRAT_SPACE_RES(mp, count_fsb);
                quota_flag = XFS_QMOPT_RES_REGBLKS;
-               numrtextents = 0;
        }
 
        /*
@@ -449,9 +449,8 @@ xfs_iomap_write_direct(
         */
        xfs_iunlock(ip, XFS_ILOCK_EXCL);
        tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT);
-       resblks = XFS_DIOSTRAT_SPACE_RES(mp, datablocks);
        error = xfs_trans_reserve(tp, resblks,
-                       XFS_WRITE_LOG_RES(mp), numrtextents,
+                       XFS_WRITE_LOG_RES(mp), resrtextents,
                        XFS_TRANS_PERM_LOG_RES,
                        XFS_WRITE_LOG_COUNT);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to