On Mon, Jan 30 2017, Artur Paszkiewicz wrote: > > +static void raid5_reset_stripe_cache(struct mddev *mddev) > +{ > + struct r5conf *conf = mddev->private; > + > + mutex_lock(&conf->cache_size_mutex); > + while (conf->max_nr_stripes && > + drop_one_stripe(conf)) > + ; > + while (conf->min_nr_stripes > conf->max_nr_stripes && > + grow_one_stripe(conf, GFP_KERNEL)) > + ; > + mutex_unlock(&conf->cache_size_mutex); > +} This is called with the raid array suspended, so any writeout to the array will block. A GFP_KERNEL allocation can block waiting for writeout. So this can deadlock. At the very least, this should use GFP_NOIO. It would be better to do something like resize_stripes() does, or maybe even just use resize_stripes(). It allocates the new stripes first before suspending IO. Then it cleans out the old stripes, and inserts the pre-allocated stripes. NeilBrown
Attachment:
signature.asc
Description: PGP signature