aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/bcache/super.c')
-rw-r--r--drivers/md/bcache/super.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index b6114d672413..60e75130a44c 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1966,10 +1966,12 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
1966 if (IS_ERR(bdev)) { 1966 if (IS_ERR(bdev)) {
1967 if (bdev == ERR_PTR(-EBUSY)) { 1967 if (bdev == ERR_PTR(-EBUSY)) {
1968 bdev = lookup_bdev(strim(path)); 1968 bdev = lookup_bdev(strim(path));
1969 mutex_lock(&bch_register_lock);
1969 if (!IS_ERR(bdev) && bch_is_open(bdev)) 1970 if (!IS_ERR(bdev) && bch_is_open(bdev))
1970 err = "device already registered"; 1971 err = "device already registered";
1971 else 1972 else
1972 err = "device busy"; 1973 err = "device busy";
1974 mutex_unlock(&bch_register_lock);
1973 } 1975 }
1974 goto err; 1976 goto err;
1975 } 1977 }