summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2017-02-08 13:52:10 -0700
committerJens Axboe <axboe@fb.com>2017-02-08 13:52:10 -0700
commit8cf4433a8295e8908731819303395d613bd9eb95 (patch)
tree4caebc1346387ddcb6b39e2f9ab9dd2acc0c19c6
parentb6fa2774c89426a6e2edd43f7c5234226ee2e455 (diff)
parent5f478e4ea5c5560b4e40eb136991a09f9389f331 (diff)
Merge branch 'for-4.11/next' into for-next
-rw-r--r--mm/backing-dev.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 28ce6cf7b2ff..39ce616a9d71 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -759,15 +759,20 @@ static int cgwb_bdi_init(struct backing_dev_info *bdi)
if (!bdi->wb_congested)
return -ENOMEM;
+ atomic_set(&bdi->wb_congested->refcnt, 1);
+
err = wb_init(&bdi->wb, bdi, 1, GFP_KERNEL);
if (err) {
- kfree(bdi->wb_congested);
+ wb_congested_put(bdi->wb_congested);
return err;
}
return 0;
}
-static void cgwb_bdi_destroy(struct backing_dev_info *bdi) { }
+static void cgwb_bdi_destroy(struct backing_dev_info *bdi)
+{
+ wb_congested_put(bdi->wb_congested);
+}
#endif /* CONFIG_CGROUP_WRITEBACK */