cluster/dlm-kernel/src device.c
CVSROOT: /cvs/cluster
Module name: cluster
Branch: STABLE
Changes by: pcaulfield at sourceware.org 2007-12-05 08:45:54
Modified files:
dlm-kernel/src : device.c
Log message:
Fix for bz#280161 Killing a userland process can leave locks hanging around
dlm-kernel/src/Attic/device.c +13 -7
@@ -544,13 +544,19 @@/* If it was waiting for a conversion, it will now be granted so we can unlock it properly */ -if (lock_status ==GDLM_LKSTS_CONVERT ) { - flags &= ~DLM_LKF_CANCEL ; -clear_bit (LI_FLAG_COMPLETE , &li.li_flags); - status =dlm_unlock (f->fi_ls->ls_lockspace, lkb->lkb_id, flags, &li.li_lksb, &li); - -if (status ==0 ) -wait_for_ast (&li); +if (lock_status ==GDLM_LKSTS_CONVERT || status == -EBUSY ) { +do { + flags &= ~DLM_LKF_CANCEL ; +clear_bit (LI_FLAG_COMPLETE , &li.li_flags); + status =dlm_unlock (f->fi_ls->ls_lockspace, lkb->lkb_id, flags, &li.li_lksb, &li); + +if (status ==0 ) +wait_for_ast (&li); + +if (status == -EBUSY ) { +msleep (1 ); + } + }while (status == -EBUSY ); } }