bcache: stop moving_gc marking buckets that can't be moved.
authorNicholas Swenson <nks@daterainc.com>
Thu, 23 Jan 2014 23:21:02 +0000 (15:21 -0800)
committerKent Overstreet <kmo@daterainc.com>
Tue, 18 Mar 2014 19:22:34 +0000 (12:22 -0700)
Signed-off-by: Nicholas Swenson <nks@daterainc.com>
drivers/md/bcache/movinggc.c

index 5e8e58701d37ec45d494a0f7f336316f3428bfc2..cd7490311e518b9139db7d95818111685d52f0fa 100644 (file)
@@ -215,7 +215,10 @@ void bch_moving_gc(struct cache_set *c)
                ca->heap.used = 0;
 
                for_each_bucket(b, ca) {
-                       if (!GC_SECTORS_USED(b))
+                       if (GC_MARK(b) == GC_MARK_METADATA ||
+                           !GC_SECTORS_USED(b) ||
+                           GC_SECTORS_USED(b) == ca->sb.bucket_size ||
+                           atomic_read(&b->pin))
                                continue;
 
                        if (!heap_full(&ca->heap)) {