Nice catch, applied.

On Sun, Jul 13, 2014 at 9:08 AM, Jianjian Huo <[email protected]> wrote:
> Since bch_is_open will iterate linked list bch_cache_sets and
> uncached_devices, it needs bch_register_lock.
>
> Signed-off-by: Jianjian Huo <[email protected]>
> ---
>  drivers/md/bcache/super.c |    2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
> index 92dcbfd..3391c53 100644
> --- a/drivers/md/bcache/super.c
> +++ b/drivers/md/bcache/super.c
> @@ -1933,10 +1933,12 @@ static ssize_t register_bcache(struct kobject *k, 
> struct kobj_attribute *attr,
>         if (IS_ERR(bdev)) {
>                 if (bdev == ERR_PTR(-EBUSY)) {
>                         bdev = lookup_bdev(strim(path));
> +                       mutex_lock(&bch_register_lock);
>                         if (!IS_ERR(bdev) && bch_is_open(bdev))
>                                 err = "device already registered";
>                         else
>                                 err = "device busy";
> +                       mutex_unlock(&bch_register_lock);
>                 }
>                 goto err;
>         }
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
> the body of a message to [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to