From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753902AbcIIPUy (ORCPT ); Fri, 9 Sep 2016 11:20:54 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:34186 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752115AbcIIPUt (ORCPT ); Fri, 9 Sep 2016 11:20:49 -0400 From: Nayeemahmed Badebade 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 Message-Id: <1473434435-27025-1-git-send-email-itachi.opsrc@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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