bcache: fix lockdep warnings on shutdown
authorSlava Pestov <sp@daterainc.com>
Tue, 29 Apr 2014 22:39:27 +0000 (15:39 -0700)
committerKent Overstreet <kmo@daterainc.com>
Mon, 4 Aug 2014 22:23:03 +0000 (15:23 -0700)
drivers/md/bcache/super.c

index 1ea9fa27ee3c71487e77019ae1fd8117175632c9..09573c2bcb5d30bc15c15a32f1fcb5653db3e07f 100644 (file)
@@ -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);
 }
This page took 0.024821 seconds and 5 git commands to generate.