On 04/01/2012 02:21 PM, MORITA Kazutaka wrote: > At Sun, 01 Apr 2012 14:06:54 +0800, > Liu Yuan wrote: >> >> On 04/01/2012 01:59 PM, MORITA Kazutaka wrote: >> >>> 'join C' is processed after there is no outstanding I/Os. >>> >> >> >> Okay, I see the race. >> >> can we remove this line in start_cpg_event_work() >> >> if (is_membership_change_event(cevent->ctype) && >> sys->nr_outstanding_io) >> return; > > No, Sheepdog assumes that the older epoch directories are read-only > (especially in recovery codes), so we need to flush all I/Os before > updating an epoch. I think it is much harder to remove this line than > introducing two queues. > How about flushing the IO before inserting the Join/Leave Event at the head? That is, before inserting, we check if sys->nr_outstanding_io == 0 This can be thought as move this line in front of inserting. Thanks, Yuan |