diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 02acd5d5a848..08a7f97750f7 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -2407,8 +2407,6 @@ static int resize_stripes(struct r5conf *conf, int newsize) } else err = -ENOMEM; - mutex_unlock(&conf->cache_size_mutex); - conf->slab_cache = sc; conf->active_name = 1-conf->active_name; @@ -2431,6 +2429,8 @@ static int resize_stripes(struct r5conf *conf, int newsize) if (!err) conf->pool_size = newsize; + mutex_unlock(&conf->cache_size_mutex); + return err; }