Whamcloud - gitweb
LU-3054 build: fix 'program hangs' errors
authorSebastien Buisson <sebastien.buisson@bull.net>
Thu, 28 Mar 2013 15:37:27 +0000 (16:37 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 31 May 2013 16:26:11 +0000 (12:26 -0400)
Fix 'program hangs' defects found by Coverity version 6.5.1:
Missing unlock (LOCK)
Returning without unlocking.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: I96c2bb05a5875ed493ebe99587e9901baea80fc8
Reviewed-on: http://review.whamcloud.com/5870
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Keith Mannthey <DELETED>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lnet/selftest/rpc.c
lustre/mdt/mdt_open.c
lustre/mdt/mdt_recovery.c

index 60282f9..b30301a 100644 (file)
@@ -691,8 +691,10 @@ srpc_finish_service(struct srpc_service *sv)
 
        cfs_percpt_for_each(scd, i, sv->sv_cpt_data) {
                spin_lock(&scd->scd_lock);
-               if (!swi_deschedule_workitem(&scd->scd_buf_wi))
+               if (!swi_deschedule_workitem(&scd->scd_buf_wi)) {
+                       spin_unlock(&scd->scd_lock);
                        return 0;
+               }
 
                if (scd->scd_buf_nposted > 0) {
                        CDEBUG(D_NET, "waiting for %d posted buffers to unlink",
index d12cb2d..2538f57 100644 (file)
@@ -585,6 +585,7 @@ static void mdt_empty_transno(struct mdt_thread_info *info, int rc)
                               mdt_obd_name(mdt), info->mti_transno,
                               libcfs_nid2str(exp->exp_connection->c_peer.nid),
                               rc);
+                       spin_unlock(&mdt->mdt_lut.lut_translock);
                        RETURN_EXIT;
                }
        } else if (info->mti_transno == 0) {
index 88de204..e7986c4 100644 (file)
@@ -534,6 +534,7 @@ static int mdt_txn_stop_cb(const struct lu_env *env,
                 if (mti->mti_transno != 0) {
                        CERROR("Replay transno "LPU64" failed: rc %d\n",
                                mti->mti_transno, txn->th_result);
+                       spin_unlock(&mdt->mdt_lut.lut_translock);
                        return 0;
                 }
         } else if (mti->mti_transno == 0) {