From 72de796538603178643c1a23da1a92fd3ae588dd Mon Sep 17 00:00:00 2001 From: shadow Date: Mon, 29 Sep 2008 06:34:12 +0000 Subject: [PATCH] fix more llog locking problems. Branch b1_8_gate b=17157 i=johann i=wangdi --- lustre/obdclass/llog_ioctl.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lustre/obdclass/llog_ioctl.c b/lustre/obdclass/llog_ioctl.c index 48b9cc1..261c031 100644 --- a/lustre/obdclass/llog_ioctl.c +++ b/lustre/obdclass/llog_ioctl.c @@ -436,11 +436,10 @@ int llog_catalog_list(struct obd_device *obd, int count, if (!idarray) RETURN(-ENOMEM); + mutex_down(&obd->obd_llog_cat_process); rc = llog_get_cat_list(obd, obd, name, 0, count, idarray); - if (rc) { - OBD_FREE(idarray, size); - RETURN(rc); - } + if (rc) + GOTO(out, rc); out = data->ioc_bulk; remains = data->ioc_inllen1; @@ -456,8 +455,12 @@ int llog_catalog_list(struct obd_device *obd, int count, break; } } +out: + /* release semaphore */ + mutex_up(&obd->obd_llog_cat_process); + OBD_VFREE(idarray, size); - RETURN(0); + RETURN(rc); } EXPORT_SYMBOL(llog_catalog_list); -- 1.8.3.1