X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fobdclass%2Fllog_ioctl.c;h=8d57e1885b4167dd81c88a20044697a861111074;hp=d1c3fa5def18c5a8bf73c25d9ea951446efce773;hb=a928591d58b5d0dbbcc9a7f534dca2b6df22da9e;hpb=6869932b552ac705f411de3362f01bd50c1f6f7d diff --git a/lustre/obdclass/llog_ioctl.c b/lustre/obdclass/llog_ioctl.c index d1c3fa5..8d57e18 100644 --- a/lustre/obdclass/llog_ioctl.c +++ b/lustre/obdclass/llog_ioctl.c @@ -432,16 +432,14 @@ int llog_catalog_list(struct obd_device *obd, int count, ENTRY; size = sizeof(*idarray) * count; - OBD_ALLOC(idarray, size); + OBD_VMALLOC(idarray, size); if (!idarray) RETURN(-ENOMEM); - memset(idarray, 0, size); - rc = llog_get_cat_list(obd, obd, name, count, idarray); - if (rc) { - OBD_FREE(idarray, size); - RETURN(rc); - } + mutex_down(&obd->obd_olg.olg_cat_processing); + rc = llog_get_cat_list(obd, name, 0, count, idarray); + if (rc) + GOTO(out, rc); out = data->ioc_bulk; remains = data->ioc_inllen1; @@ -457,8 +455,12 @@ int llog_catalog_list(struct obd_device *obd, int count, break; } } - OBD_FREE(idarray, size); - RETURN(0); +out: + /* release semaphore */ + mutex_up(&obd->obd_olg.olg_cat_processing); + + OBD_VFREE(idarray, size); + RETURN(rc); } EXPORT_SYMBOL(llog_catalog_list);