From: Tolga Ceylan <tolga.ceylan@gmail.com>
To: Oleg Drokin <oleg.drokin@intel.com>,
Andreas Dilger <andreas.dilger@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Julia Lawall <Julia.Lawall@lip6.fr>,
Arjun AK <arjunak234@gmail.com>, Greg Donald <gdonald@gmail.com>,
Darshana Padmadas <darshanapadmadas@gmail.com>,
Tolga Ceylan <tolga.ceylan@gmail.com>,
Joe Perches <joe@perches.com>,
HPDD-discuss@ml01.01.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/1] staging: lustre/lustre/obdclass/llog_cat.c: get rid of sparse context imbalance warning
Date: Wed, 3 Jun 2015 13:20:10 -0700 [thread overview]
Message-ID: <1433362810-14176-1-git-send-email-tolga.ceylan@gmail.com> (raw)
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@gmail.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
next reply other threads:[~2015-06-03 20:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-03 20:20 Tolga Ceylan [this message]
2015-06-08 19:35 ` [PATCH 1/1] staging: lustre/lustre/obdclass/llog_cat.c: get rid of sparse context imbalance warning Greg Kroah-Hartman
-- strict thread matches above, loose matches on Subject: below --
2015-06-02 19:57 Tolga Ceylan
2015-06-03 6:42 ` Sudip Mukherjee
2015-06-03 15:47 ` Tolga Ceylan
2015-06-03 16:36 ` Sudip Mukherjee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1433362810-14176-1-git-send-email-tolga.ceylan@gmail.com \
--to=tolga.ceylan@gmail.com \
--cc=HPDD-discuss@ml01.01.org \
--cc=Julia.Lawall@lip6.fr \
--cc=andreas.dilger@intel.com \
--cc=arjunak234@gmail.com \
--cc=darshanapadmadas@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gdonald@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg.drokin@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox