xfs
[Top] [All Lists]

Re: [PATCH 30/37] libxfs: work around do_div() not handling 32 bit numer

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 30/37] libxfs: work around do_div() not handling 32 bit numerators
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 7 Nov 2013 12:54:54 -0800
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1383700043-32305-31-git-send-email-david@xxxxxxxxxxxxx>
References: <1383700043-32305-1-git-send-email-david@xxxxxxxxxxxxx> <1383700043-32305-31-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, Nov 06, 2013 at 12:07:16PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>

Looks good,

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

<Prev in Thread] Current Thread [Next in Thread>