From: Slava Pestov Date: Tue, 29 Apr 2014 22:39:27 +0000 (-0700) Subject: bcache: fix lockdep warnings on shutdown X-Git-Tag: firefly_0821_release~176^2~3399^2^2~17 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e5112201c1285841f8b565ece5d6ae7e0d7947a2;p=firefly-linux-kernel-4.4.55.git bcache: fix lockdep warnings on shutdown --- diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 1ea9fa27ee3c..09573c2bcb5d 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1214,7 +1214,9 @@ void bch_flash_dev_release(struct kobject *kobj) static void flash_dev_free(struct closure *cl) { struct bcache_device *d = container_of(cl, struct bcache_device, cl); + mutex_lock(&bch_register_lock); bcache_device_free(d); + mutex_unlock(&bch_register_lock); kobject_put(&d->kobj); } @@ -1222,7 +1224,9 @@ static void flash_dev_flush(struct closure *cl) { struct bcache_device *d = container_of(cl, struct bcache_device, cl); + mutex_lock(&bch_register_lock); bcache_device_unlink(d); + mutex_unlock(&bch_register_lock); kobject_del(&d->kobj); continue_at(cl, flash_dev_free, system_wq); }