Skip to content

Commit

Permalink
[GFS2] Fix GFS2's use of do_div() in its quota calculations
Browse files Browse the repository at this point in the history
Fix GFS2's need_sync()'s use of do_div() on an s64 by using div_s64() instead.

This does assume that gt_quota_scale_den can be cast to an s32.

This was introduced by patch b3b94fa.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
David Howells authored and Steven Whitehouse committed Jul 11, 2008
1 parent a93a6ce commit 4abaca1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/gfs2/quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ static int need_sync(struct gfs2_quota_data *qd)
do_sync = 0;
else {
value *= gfs2_jindex_size(sdp) * num;
do_div(value, den);
value = div_s64(value, den);
value += (s64)be64_to_cpu(qd->qd_qb.qb_value);
if (value < (s64)be64_to_cpu(qd->qd_qb.qb_limit))
do_sync = 0;
Expand Down

0 comments on commit 4abaca1

Please sign in to comment.