[Devel] [PATCH rh7] fs/mm: writeback: fix div/0
Vladimir Davydov
vdavydov at virtuozzo.com
Wed Apr 13 10:01:10 PDT 2016
https://jira.sw.ru/browse/PSBM-46146
Fixes: d179e86ac429 ("fs/mm: writeback: fix per bdi dirty background threshold calculation")
Signed-off-by: Vladimir Davydov <vdavydov at virtuozzo.com>
---
fs/fs-writeback.c | 2 +-
mm/page-writeback.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 55eca543f921..5c9a0828ba18 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -845,7 +845,7 @@ static bool over_bground_thresh(struct backing_dev_info *bdi)
bdi_thresh = bdi_dirty_limit(bdi, dirty_thresh);
bdi_bg_thresh = div_u64((u64)bdi_thresh * background_thresh,
- dirty_thresh);
+ dirty_thresh + 1);
if (bdi_stat(bdi, BDI_RECLAIMABLE) > bdi_bg_thresh)
return true;
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 46987e86c5a0..3b881f30dbe5 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -791,7 +791,8 @@ static unsigned long bdi_position_ratio(struct backing_dev_info *bdi,
if (bdi_dirty >= bdi_thresh)
return 0;
- bdi_bg_thresh = div_u64((u64)bdi_thresh * bg_thresh, thresh);
+ bdi_bg_thresh = div_u64((u64)bdi_thresh * bg_thresh,
+ thresh + 1);
bdi_setpoint = dirty_freerun_ceiling(bdi_thresh,
bdi_bg_thresh);
--
2.1.4
More information about the Devel
mailing list