Skip to contentSkip to conversation

Fix GFS2's use of do_div() in its quota calculations

PATCH Steven Whitehouse 1 participant 1 message Jul 11, 2008 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi,

Now in the GFS2 -nmw git tree. Thanks,

Steve.

Quoted 27 lines · David Howells

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 b3b94faa5fe5968827ba0640ee9fba4b3e7f736e.

---

 fs/gfs2/quota.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/gfs2/quota.c +1 -1
index 56aaf91..3e073f5 100644
@@ -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;