On Wed, Jul 20, 2016 at 05:22:00PM +0800, Zhengyuan Liu wrote: > The counter conf->empty_inactive_list_nr is only used for determine if > the raid5 is congested which is deal with in function > raid5_congested(). It was increased in get_free_stripe() when > conf->inactive_list got emptied and decreased in > release_inactive_stripe_list() when splice temp_inactive_list to > conf->inactive_list. However, this could cause to problem when > raid5_get_active_stripe was called, this function may call > list_del_init(&sh->lru) to delete sh from "conf->inactive_list + > hash" which may cause "conf->inactive_list + hash" to be empty when > atomic_inc_not_zero(&sh->count) got false. > I have found conf->empty_inactive_list_nr to be negative number > during my random test. > Is there anything out of my thinking? Good catch! I think you are right, we get a stripe from inactive list and should decrement the count. Also we should do the same thing for stripe_add_to_batch_list. Please resend the patch with proper format, see Documentation/email-clients.txt Thanks, Shaohua -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html