On Fri, Nov 22, 2024 at 4:32 PM Yu Kuai <yukuai1@xxxxxxxxxxxxxxx> wrote: > > Hi, > > 在 2024/11/22 11:14, Xiao Ni 写道: > >> Ok, one place that I found is that raid5 can do extra end write while > >> stripe->dev[].towrite is NULL, the null checking is missing. I'll > >> mention that in the next version. > > Does this can cause the deadlock? > > Not deadlock, the bit counter will underflow and reach COUNTER_MAX, and > bitmap_startwrite() can wait forever for the counter. Hi Kuai For normal io, endwrite is called in function handle_stripe_clean_event when sh->dev[i].written has value. For failed io, endwrite is called when bitmap_end has value. bitmap_end is set when sh->dev[i].to_write is not NULL. Which place does extra endwrite? Regards Xiao > > Thanks, > Kuai >