[PATCH 30/37] libxfs: work around do_div() not handling 32 bit numerators
Christoph Hellwig
hch at infradead.org
Thu Nov 7 14:54:54 CST 2013
On Wed, Nov 06, 2013 at 12:07:16PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner at redhat.com>
>
> The libxfs dquot buffer code uses do_div() with a 32 bit numerator.
> This gives incorrect results as do_div() passes the numerator by
> reference as a pointer to a 64 bit value. Hence it does the division
> using 32 bits of garbage gives the wrong result.
>
> As per Christoph's suggestion, we can kill the usage of do_div()
> here completely and just do the division directly, both in userspace
> and kernel space.
>
> Signed-off-by: Dave Chinner <dchinner at redhat.com>
Looks good,
Reviewed-by: Christoph Hellwig <hch at lst.de>
More information about the xfs
mailing list