aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/super.c
diff options
context:
space:
mode:
authorKent Overstreet <koverstreet@google.com>2013-05-11 20:07:26 -0400
committerKent Overstreet <koverstreet@google.com>2013-06-26 20:09:16 -0400
commit444fc0b6b167ed164e7436621a9d095e042644dd (patch)
tree4625e5b019f6f36794268c358fad393248df5bd6 /drivers/md/bcache/super.c
parent6ded34d1a54c046a45db071d3cb7b37bd0a4a31f (diff)
bcache: Initialize sectors_dirty when attaching
Previously, dirty_data wouldn't get initialized until the first garbage collection... which was a bit of a problem for background writeback (as the PD controller keys off of it) and also confusing for users. This is also prep work for making background writeback aware of raid5/6 stripes. Signed-off-by: Kent Overstreet <koverstreet@google.com>
Diffstat (limited to 'drivers/md/bcache/super.c')
-rw-r--r--drivers/md/bcache/super.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 3c8474161e8e..dbfa1c38e85e 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -961,6 +961,7 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c)
961 atomic_set(&dc->count, 1); 961 atomic_set(&dc->count, 1);
962 962
963 if (BDEV_STATE(&dc->sb) == BDEV_STATE_DIRTY) { 963 if (BDEV_STATE(&dc->sb) == BDEV_STATE_DIRTY) {
964 bch_sectors_dirty_init(dc);
964 atomic_set(&dc->has_dirty, 1); 965 atomic_set(&dc->has_dirty, 1);
965 atomic_inc(&dc->count); 966 atomic_inc(&dc->count);
966 bch_writeback_queue(dc); 967 bch_writeback_queue(dc);