Skip to contentSkip to conversation

staging: lustre: Fix 'unexpected unlock' warning generated by sparse

PATCH In review Niranjan Dighe 2 participants 3 messages Jan 3, 2016 – Feb 7, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lustre: Fix 'unexpected unlock' warning generated by sparse

Added annotation '__must_hold' to function ksocknal_send_keepalive_locked which unlocks the lock ksocknal_data.ksnd_global_lock. As this lock is not acquired in the current function, sparse warns about context imbalance

---
 drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c +1 -0
index 477b385..29525a0 100644
@@ -2336,6 +2336,7 @@ ksocknal_flush_stale_txs(ksock_peer_t *peer)
 
 static int
 ksocknal_send_keepalive_locked(ksock_peer_t *peer)
+__must_hold(&ksocknal_data.ksnd_global_lock)
 {
 	ksock_sched_t *sched;
 	ksock_conn_t *conn;
Signature · 1 line
1.9.1
#1 lore raw
Quoted 8 lines · Niranjan Dighe

Added annotation '__must_hold' to function ksocknal_send_keepalive_locked which unlocks the lock ksocknal_data.ksnd_global_lock. As this lock is not acquired in the current function, sparse warns about context imbalance

---
 drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 1 +
 1 file changed, 1 insertion(+)

Doesn't apply to my tree :(

#2 lore raw
Quoted 11 lines · Greg Kroah-Hartman
Quoted 8 lines · Niranjan Dighe

Added annotation '__must_hold' to function ksocknal_send_keepalive_locked which unlocks the lock ksocknal_data.ksnd_global_lock. As this lock is not acquired in the current function, sparse warns about context imbalance

---
 drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 1 +
 1 file changed, 1 insertion(+)

Doesn't apply to my tree :(

Sorry about this Greg, I will recreate it on the latest staging-next and resend.

Thanks,
Niranjan Dighe