Whamcloud - gitweb
LU-4055 build: fix 'error handling' issues 42/7842/3
authorSebastien Buisson <sebastien.buisson@bull.net>
Thu, 3 Oct 2013 07:28:09 +0000 (09:28 +0200)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 2 Nov 2013 00:57:01 +0000 (00:57 +0000)
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 <sebastien.buisson@bull.net>
Change-Id: I1ea3428febee741be15215fcc89266a814e5fe1b
Reviewed-on: http://review.whamcloud.com/7842
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mgc/mgc_request.c
lustre/utils/lustre_cfg.c

index 5c130be..94b8d8d 100644 (file)
@@ -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;
index ab5a68f..4036828 100644 (file)
@@ -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;
                        }