diff options
-rw-r--r-- | drivers/md/bcache/buckets.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/md/bcache/buckets.c b/drivers/md/bcache/buckets.c index 8808dda9efb2..4c6a2c65087a 100644 --- a/drivers/md/bcache/buckets.c +++ b/drivers/md/bcache/buckets.c @@ -199,6 +199,15 @@ u8 bch_mark_data_bucket(struct cache_set *c, struct cache *ca, struct bkey *k, if (!gc && gc_will_visit_key(c, k)) return 0; + /* + * Disallowed state transition - this means a bkey_cmpxchg() + * operation is racing; just treat it like the pointer was + * already stale + */ + if (!gc && dirty && + is_available_bucket(old)) + return 1; + BUG_ON(old.is_metadata); if (dirty && new.dirty_sectors == GC_MAX_SECTORS_USED && |