linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nayeemahmed Badebade <itachi.opsrc@gmail.com>
To: oleg.drokin@intel.com, andreas.dilger@intel.com, jsimmons@infradead.org
Cc: gregkh@linuxfoundation.org, bruce.korb@gmail.com,
	Keith.Mannthey@intel.com, lustre-devel@lists.lustre.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] staging: lustre: lustre/ldlm: Fixed sparse warnings
Date: Fri,  9 Sep 2016 20:50:35 +0530	[thread overview]
Message-ID: <1473434435-27025-1-git-send-email-itachi.opsrc@gmail.com> (raw)

Added __acquires / __releases sparse locking annotations
to lock_res_and_lock and unlock_res_and_lock functions in
l_lock.c, to fix below sparse warnings:

 l_lock.c:47:22: warning: context imbalance in 'lock_res_and_lock' - wrong count at exit
 l_lock.c:62:6: warning: context imbalance in 'unlock_res_and_lock' - unexpected unlock

Signed-off-by: Nayeemahmed Badebade <itachi.opsrc@gmail.com>
---
 drivers/staging/lustre/lustre/ldlm/l_lock.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/lustre/lustre/ldlm/l_lock.c b/drivers/staging/lustre/lustre/ldlm/l_lock.c
index ea8840c..c4b9612 100644
--- a/drivers/staging/lustre/lustre/ldlm/l_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/l_lock.c
@@ -45,6 +45,8 @@
  * being an atomic operation.
  */
 struct ldlm_resource *lock_res_and_lock(struct ldlm_lock *lock)
+				__acquires(&lock->l_lock)
+				__acquires(lock->l_resource)
 {
 	spin_lock(&lock->l_lock);

@@ -59,6 +61,8 @@ EXPORT_SYMBOL(lock_res_and_lock);
  * Unlock a lock and its resource previously locked with lock_res_and_lock
  */
 void unlock_res_and_lock(struct ldlm_lock *lock)
+		__releases(lock->l_resource)
+		__releases(&lock->l_lock)
 {
 	/* on server-side resource of lock doesn't change */
 	ldlm_clear_res_locked(lock);
--
1.9.1

             reply	other threads:[~2016-09-09 15:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-09 15:20 Nayeemahmed Badebade [this message]
2016-09-12 10:27 ` [PATCH] staging: lustre: lustre/ldlm: Fixed sparse warnings Greg KH
2016-09-14  5:14   ` Dilger, Andreas
2016-09-15 18:33     ` nayeem
2016-09-16  8:00       ` Dilger, Andreas
2016-09-18 20:21         ` nayeem
2016-09-18 20:29           ` Dilger, Andreas
2016-09-18 21:18             ` [PATCH v2] " Nayeemahmed Badebade
2016-09-18 21:27               ` Dilger, Andreas
2016-09-19 20:43               ` James Simmons

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=1473434435-27025-1-git-send-email-itachi.opsrc@gmail.com \
    --to=itachi.opsrc@gmail.com \
    --cc=Keith.Mannthey@intel.com \
    --cc=andreas.dilger@intel.com \
    --cc=bruce.korb@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jsimmons@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.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;
as well as URLs for NNTP newsgroup(s).