From 6b9be9fb417cdbfe32b74e1f17bed599fc555be8 Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Thu, 3 Oct 2013 09:28:09 +0200 Subject: [PATCH] LU-4055 build: fix 'error handling' issues Fix 'error handling' issues found by Coverity version 6.6.1: Unchecked return value (CHECKED_RETURN) Calling function without checking return value. Argument cannot be negative (NEGATIVE_RETURNS) Negative value used as argument to a function expecting a positive value. Signed-off-by: Sebastien Buisson Change-Id: I1ea3428febee741be15215fcc89266a814e5fe1b Reviewed-on: http://review.whamcloud.com/7842 Reviewed-by: Dmitry Eremin Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Nunez Reviewed-by: Oleg Drokin --- lustre/mgc/mgc_request.c | 17 ++++++++++------- lustre/utils/lustre_cfg.c | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lustre/mgc/mgc_request.c b/lustre/mgc/mgc_request.c index 5c130be..94b8d8d 100644 --- a/lustre/mgc/mgc_request.c +++ b/lustre/mgc/mgc_request.c @@ -501,6 +501,7 @@ static DECLARE_COMPLETION(rq_exit); static void do_requeue(struct config_llog_data *cld) { + int rc = 0; ENTRY; LASSERT(cfs_atomic_read(&cld->cld_refcount) > 0); @@ -508,13 +509,15 @@ static void do_requeue(struct config_llog_data *cld) export which is being disconnected. Take the client semaphore to make the check non-racy. */ down_read(&cld->cld_mgcexp->exp_obd->u.cli.cl_sem); - if (cld->cld_mgcexp->exp_obd->u.cli.cl_conn_count != 0) { - CDEBUG(D_MGC, "updating log %s\n", cld->cld_logname); - mgc_process_log(cld->cld_mgcexp->exp_obd, cld); - } else { - CDEBUG(D_MGC, "disconnecting, won't update log %s\n", - cld->cld_logname); - } + if (cld->cld_mgcexp->exp_obd->u.cli.cl_conn_count != 0) { + CDEBUG(D_MGC, "updating log %s\n", cld->cld_logname); + rc = mgc_process_log(cld->cld_mgcexp->exp_obd, cld); + if (rc && rc != -ENOENT) + CERROR("failed processing log: %d\n", rc); + } else { + CDEBUG(D_MGC, "disconnecting, won't update log %s\n", + cld->cld_logname); + } up_read(&cld->cld_mgcexp->exp_obd->u.cli.cl_sem); EXIT; diff --git a/lustre/utils/lustre_cfg.c b/lustre/utils/lustre_cfg.c index ab5a68f..4036828 100644 --- a/lustre/utils/lustre_cfg.c +++ b/lustre/utils/lustre_cfg.c @@ -554,7 +554,7 @@ static int jt_lcfg_mgsparam2(int argc, char **argv, struct param_opts *popt) int rc2 = lcfg_mgs_ioctl(argv[0], OBD_DEV_ID, lcfg); if (rc2 != 0) { fprintf(stderr, "error: executing %s: %s\n", - jt_cmdname(argv[0]), strerror(rc2)); + jt_cmdname(argv[0]), strerror(errno)); if (rc == 0) rc = rc2; } -- 1.8.3.1