|
Description
|
If I do 'xm block-detach' right after 'xm block-attach' to the same vbd, xdf can hang.
This is caused by xdf not handling XenbusStateClosing oestate change well.
'xm block-detach' will change backend xenbus state to XenbusStateClosing. This can happen before backend state being switched to XenbusStateConnected (i.e. 'xm block-detach' before xdb and xdf is connected). So, xdf will see XenbusStateClosing (changed by 'xm block-detach') before XenbusStateConnected (changed by xdb). In this case, xdf should ignore XenbusStateConnected and keep doing detaching (since in handling XenbusStateClosing, it switched itself to XenbusStateClosed to tell xdb to close). But, in handing XenbusStateClosing in xdf_oe_change(), xdf did not change vdp->xdf_status to XD_CLSOING, but leave it as XD_INIT. Thus, when xdf saw XenbusStateConnected, it will wrongly keep connecting to xdb and cause a hang since at that time, xdb is closed already.
|