From: Robert R. <rr...@us...> - 2003-05-13 14:19:50
|
Update of /cvsroot/lustre/lustre/obdclass In directory sc8-pr-cvs1:/tmp/cvs-serv16667/obdclass Modified Files: Tag: b_devel class_obd.c Log Message: b=1279 Add a timeout and allow signals during the obd_refcount wait. If the wait ends prematurely, then dump the exports. Index: class_obd.c =================================================================== RCS file: /cvsroot/lustre/lustre/obdclass/class_obd.c,v retrieving revision 1.162.2.21 retrieving revision 1.162.2.22 diff -u -w -b -B -p -r1.162.2.21 -r1.162.2.22 --- class_obd.c 7 May 2003 23:39:26 -0000 1.162.2.21 +++ class_obd.c 13 May 2003 14:19:46 -0000 1.162.2.22 @@ -181,7 +181,7 @@ static void dump_exports(struct obd_devi list_for_each_safe(tmp, n, &obd->obd_exports) { struct obd_export *exp = list_entry(tmp, struct obd_export, exp_obd_chain); - CDEBUG(D_INFO, "%s: %p %s %d %d %p\n", + CDEBUG(D_ERROR, "%s: %p %s %d %d %p\n", obd->obd_name, exp, exp->exp_client_uuid.uuid, atomic_read(&exp->exp_refcount), exp->exp_failed, exp->exp_outstanding_reply ); @@ -593,7 +593,10 @@ int class_handle_ioctl(struct obd_class_ } if (atomic_read(&obd->obd_refcount) > 1) { - struct l_wait_info lwi = { 0 }; + struct l_wait_info lwi = LWI_TIMEOUT_INTR(60 * HZ, NULL, + NULL, NULL); + int rc; + if (!force) { CERROR("OBD device %d (%p) has refcount %d\n", obd->obd_minor, obd, @@ -606,11 +609,16 @@ int class_handle_ioctl(struct obd_class_ "%s: waiting for obd refs to go away: %d\n", obd->obd_name, atomic_read(&obd->obd_refcount)); - l_wait_event(obd->obd_refcount_waitq, + rc = l_wait_event(obd->obd_refcount_waitq, atomic_read(&obd->obd_refcount) < 2, &lwi); - + if (rc == 0) { LASSERT(atomic_read(&obd->obd_refcount) == 1); - + } else { + CERROR("wait cancelled cleaning anyway. " + "refcount: %d\n", + atomic_read(&obd->obd_refcount)); + dump_exports(obd); + } CDEBUG(D_IOCTL, "%s: awake, now finishing cleanup\n", obd->obd_name); } |