All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: lustre: lustre/ldlm: Fixed sparse warnings
@ 2016-09-09 15:20 Nayeemahmed Badebade
  2016-09-12 10:27   ` [lustre-devel] " Greg KH
  0 siblings, 1 reply; 16+ messages in thread
From: Nayeemahmed Badebade @ 2016-09-09 15:20 UTC (permalink / raw)
  To: oleg.drokin, andreas.dilger, jsimmons
  Cc: gregkh, bruce.korb, Keith.Mannthey, lustre-devel, devel, linux-kernel

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

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-09-19 20:43 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-09 15:20 [PATCH] staging: lustre: lustre/ldlm: Fixed sparse warnings Nayeemahmed Badebade
2016-09-12 10:27 ` Greg KH
2016-09-12 10:27   ` [lustre-devel] " Greg KH
2016-09-14  5:14   ` Dilger, Andreas
2016-09-14  5:14     ` [lustre-devel] " Dilger, Andreas
2016-09-15 18:33     ` nayeem
2016-09-16  8:00       ` Dilger, Andreas
2016-09-16  8:00         ` [lustre-devel] " Dilger, Andreas
2016-09-18 20:21         ` nayeem
2016-09-18 20:29           ` Dilger, Andreas
2016-09-18 20:29             ` [lustre-devel] " Dilger, Andreas
2016-09-18 21:18             ` [PATCH v2] " Nayeemahmed Badebade
2016-09-18 21:27               ` Dilger, Andreas
2016-09-18 21:27                 ` [lustre-devel] " Dilger, Andreas
2016-09-19 20:43               ` James Simmons
2016-09-19 20:43                 ` [lustre-devel] " James Simmons

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.