lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1433362810-14176-1-git-send-email-tolga.ceylan@gmail.com>
Date:	Wed,  3 Jun 2015 13:20:10 -0700
From:	Tolga Ceylan <tolga.ceylan@...il.com>
To:	Oleg Drokin <oleg.drokin@...el.com>,
	Andreas Dilger <andreas.dilger@...el.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Julia Lawall <Julia.Lawall@...6.fr>,
	Arjun AK <arjunak234@...il.com>,
	Greg Donald <gdonald@...il.com>,
	Darshana Padmadas <darshanapadmadas@...il.com>,
	Tolga Ceylan <tolga.ceylan@...il.com>,
	Joe Perches <joe@...ches.com>, HPDD-discuss@...ts.01.org,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/1] staging: lustre/lustre/obdclass/llog_cat.c: get rid of sparse context imbalance warning

In llog_cat_new_log(), sparse emits a context imbalance (unexpected lock)
warning due its inability to detect the noreturn attribute in
lbug_with_lock() function inside LBUG macro. With this patch, we unlock
the spinlock before checking the error condition to resolve this warning.

Signed-off-by: Tolga Ceylan <tolga.ceylan@...il.com>
---
 drivers/staging/lustre/lustre/obdclass/llog_cat.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/llog_cat.c b/drivers/staging/lustre/lustre/obdclass/llog_cat.c
index c8f6ab0..280e861 100644
--- a/drivers/staging/lustre/lustre/obdclass/llog_cat.c
+++ b/drivers/staging/lustre/lustre/obdclass/llog_cat.c
@@ -103,13 +103,13 @@ static int llog_cat_new_log(const struct lu_env *env,
 
 	spin_lock(&loghandle->lgh_hdr_lock);
 	llh->llh_count++;
-	if (ext2_set_bit(index, llh->llh_bitmap)) {
+	rc = ext2_set_bit(index, llh->llh_bitmap);
+	spin_unlock(&loghandle->lgh_hdr_lock);
+	if (rc) {
 		CERROR("argh, index %u already set in log bitmap?\n",
 		       index);
-		spin_unlock(&loghandle->lgh_hdr_lock);
 		LBUG(); /* should never happen */
 	}
-	spin_unlock(&loghandle->lgh_hdr_lock);
 
 	cathandle->lgh_last_idx = index;
 	llh->llh_tail.lrt_index = index;
-- 
2.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ