public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Love <robert.w.love@intel.com>
To: linux-scsi@vger.kernel.org
Cc: abjoglek@cisco.com, giridhar.malavali@qlogic.com,
	james.smart@emulex.com, bprakash@broadcom.com
Subject: [RFC PATCH v2 02/10] fcoe: Remove mutex_trylock/restart_syscall checks
Date: Fri, 11 Mar 2011 13:54:39 -0800	[thread overview]
Message-ID: <20110311215439.18760.76775.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20110311215428.18760.80632.stgit@localhost6.localdomain6>

These checks were initially added to avoid a lockdep
false positive when dealing with the s_active, rtnl
and fcoe_config_mutex mutexes. Recently the create,
destroy, enable and disable sysfs entries were moved
from fcoe.ko to libfcoe.ko. With this change the mutex
usage was shuffled around and the lockdep false
positive stopped happening. We can now remove these
checks.

Signed-off-by: Robert Love <robert.w.love@intel.com>
---
 drivers/scsi/fcoe/fcoe.c |   24 ++++--------------------
 1 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 94fb480..488b7d9 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -1797,11 +1797,7 @@ static int fcoe_disable(struct net_device *netdev)
 	}
 #endif
 
-	if (!rtnl_trylock()) {
-		mutex_unlock(&fcoe_config_mutex);
-		return -ERESTARTSYS;
-	}
-
+	rtnl_lock();
 	fcoe = fcoe_hostlist_lookup_port(netdev);
 	rtnl_unlock();
 
@@ -1841,11 +1837,7 @@ static int fcoe_enable(struct net_device *netdev)
 		goto out_nodev;
 	}
 #endif
-	if (!rtnl_trylock()) {
-		mutex_unlock(&fcoe_config_mutex);
-		return -ERESTARTSYS;
-	}
-
+	rtnl_lock();
 	fcoe = fcoe_hostlist_lookup_port(netdev);
 	rtnl_unlock();
 
@@ -1884,11 +1876,7 @@ static int fcoe_destroy(struct net_device *netdev)
 		goto out_nodev;
 	}
 #endif
-	if (!rtnl_trylock()) {
-		mutex_unlock(&fcoe_config_mutex);
-		return -ERESTARTSYS;
-	}
-
+	rtnl_lock();
 	fcoe = fcoe_hostlist_lookup_port(netdev);
 	if (!fcoe) {
 		rtnl_unlock();
@@ -1950,11 +1938,7 @@ static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode)
 	struct fc_lport *lport;
 
 	mutex_lock(&fcoe_config_mutex);
-
-	if (!rtnl_trylock()) {
-		mutex_unlock(&fcoe_config_mutex);
-		return -ERESTARTSYS;
-	}
+	rtnl_lock();
 
 #ifdef CONFIG_FCOE_MODULE
 	/*


  parent reply	other threads:[~2011-03-11 21:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-11 21:54 [RFC PATCH v2 00/10] FC Sysfs and FCoE attributes Robert Love
2011-03-11 21:54 ` [RFC PATCH v2 01/10] libfcoe: Remove mutex_trylock/restart_syscall checks Robert Love
2011-03-11 21:54 ` Robert Love [this message]
2011-03-11 21:54 ` [RFC PATCH v2 03/10] fc: Create FC sybsystem Robert Love
2011-03-11 21:54 ` [RFC PATCH v2 04/10] scsi_transport_fcp: Create FC/SCSI interaction layer Robert Love
2011-03-11 21:54 ` [RFC PATCH v2 05/10] libfc, libfcoe, fcoe: Make use of FC subsystem Robert Love
2011-03-11 21:55 ` [RFC PATCH v2 06/10] fc: Add FCoE attributes to FC sysfs Robert Love
2011-03-11 21:55 ` [RFC PATCH v2 07/10] libfcoe, fcoe: Use FCoE attributes Robert Love
2011-03-11 21:55 ` [RFC PATCH v2 08/10] fnic: Convert to new FC Sysfs infrastructure Robert Love
2011-03-11 21:55 ` [RFC PATCH v2 09/10] fc: Add a hbaapi_lib attribute to the fcport structure Robert Love
2011-03-11 21:55 ` [RFC PATCH v2 10/10] Documentation: Add fc_sysfs document Robert Love

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=20110311215439.18760.76775.stgit@localhost6.localdomain6 \
    --to=robert.w.love@intel.com \
    --cc=abjoglek@cisco.com \
    --cc=bprakash@broadcom.com \
    --cc=giridhar.malavali@qlogic.com \
    --cc=james.smart@emulex.com \
    --cc=linux-scsi@vger.kernel.org \
    /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