[Drbd-dev] DRBD-8 - after_state_ch() can attempt to terminateworker thread with wait==true

Graham, Simon Simon.Graham at stratus.com
Mon Aug 7 16:24:29 CEST 2006


Found one more place where this occurs -- drbd_sync_handshake which runs
in the context of the receiver thread can call drbd_force_state() in
error cases which will eventually call after_state_ch() since the
ScheduleAfter flag is not set.

/simgr


> -----Original Message-----
> From: drbd-dev-bounces at linbit.com [mailto:drbd-dev-bounces at linbit.com]
> On Behalf Of Graham, Simon
> Sent: Monday, August 07, 2006 9:33 AM
> To: drbd-dev at linbit.com
> Subject: [Drbd-dev] DRBD-8 - after_state_ch() can attempt to
> terminateworker thread with wait==true
> 
> Near the end of after_state_ch() there are several clauses that stop
> (and restart) receiver and worker threads synchronously - since this
> function is called from both the worker and receiver thread context,
> these calls cannot be made synchronously (and an ASSERT in
> _drbd_thread_stop will fire).
> 
> There seem to be a couple of issues here:
> 
> 1. Is it the intention that after_state_ch is always called from the
> worker thread? If so, then the calls in drbd_receiver and
>    drbd_fs need to change to submit work items
> 
> 2. No matter what, it should not issue synchronous calls to
> drbd_thread_stop for non-current threads.
> 
> 3. In receive_state() -- should after_state_ch() be called at all if
> the
> preceding call to _drbd_set_state fails? It seems a
>    bit wrong to me to pass in the new state to after_state_ch when you
> know this does not represent the actual new state...
> 
> 4. Ditto receive_outdate().
> 
> Simon
> _______________________________________________
> drbd-dev mailing list
> drbd-dev at lists.linbit.com
> http://lists.linbit.com/mailman/listinfo/drbd-dev


More information about the drbd-dev mailing list