libxfs: clean up _calc_dquots_per_chunk
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 20 Oct 2016 04:46:18 +0000 (15:46 +1100)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 Feb 2017 10:03:25 +0000 (11:03 +0100)
commit 58d789678546d46d7bbd809dd7dab417c0f23655 upstream.

The function xfs_calc_dquots_per_chunk takes a parameter in units
of basic blocks.  The kernel seems to get the units wrong, but
userspace got 'fixed' by commenting out the unnecessary conversion.
Fix both.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
fs/xfs/xfs_dquot.c

index bac3e1635b7d3ba53a0f71914b4db61f951e8b24..e59f309efbee9dc2c760d8233fdc6f1006fb8424 100644 (file)
@@ -309,8 +309,7 @@ xfs_dquot_buf_verify_crc(
        if (mp->m_quotainfo)
                ndquots = mp->m_quotainfo->qi_dqperchunk;
        else
-               ndquots = xfs_qm_calc_dquots_per_chunk(mp,
-                                       XFS_BB_TO_FSB(mp, bp->b_length));
+               ndquots = xfs_qm_calc_dquots_per_chunk(mp, bp->b_length);
 
        for (i = 0; i < ndquots; i++, d++) {
                if (!xfs_verify_cksum((char *)d, sizeof(struct xfs_dqblk),