public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Love <robert.w.love@intel.com>
To: James.Bottomley@suse.de, linux-scsi@vger.kernel.org
Cc: Ross Brattain <ross.b.brattain@intel.com>, Yi Zou <yi.zou@intel.com>
Subject: [PATCH 03/11] fcoe: remove unnecessary module state check
Date: Fri, 01 Apr 2011 16:06:04 -0700	[thread overview]
Message-ID: <20110401230604.15001.56084.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20110401230548.15001.2009.stgit@localhost6.localdomain6>

From: Yi Zou <yi.zou@intel.com>

The check of module state being MODULE_STATE_LIVE is no longer needed for the
individual fcoe transport driver, e.g., fcoe.ko, as sysfs entries now go to
libfcoe now, if it reaches fcoe.ko, it has to be already registered. The module
state check for libfcoe will guard the possible race condition of sysfs being
writable before module_init function is called and after module_exit.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
 drivers/scsi/fcoe/fcoe.c |   47 ----------------------------------------------
 1 files changed, 0 insertions(+), 47 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 9e7206e..34408d9 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -1783,17 +1783,6 @@ static int fcoe_disable(struct net_device *netdev)
 	int rc = 0;
 
 	mutex_lock(&fcoe_config_mutex);
-#ifdef CONFIG_FCOE_MODULE
-	/*
-	 * Make sure the module has been initialized, and is not about to be
-	 * removed.  Module paramter sysfs files are writable before the
-	 * module_init function is called and after module_exit.
-	 */
-	if (THIS_MODULE->state != MODULE_STATE_LIVE) {
-		rc = -ENODEV;
-		goto out_nodev;
-	}
-#endif
 
 	rtnl_lock();
 	fcoe = fcoe_hostlist_lookup_port(netdev);
@@ -1805,7 +1794,6 @@ static int fcoe_disable(struct net_device *netdev)
 	} else
 		rc = -ENODEV;
 
-out_nodev:
 	mutex_unlock(&fcoe_config_mutex);
 	return rc;
 }
@@ -1824,17 +1812,6 @@ static int fcoe_enable(struct net_device *netdev)
 	int rc = 0;
 
 	mutex_lock(&fcoe_config_mutex);
-#ifdef CONFIG_FCOE_MODULE
-	/*
-	 * Make sure the module has been initialized, and is not about to be
-	 * removed.  Module paramter sysfs files are writable before the
-	 * module_init function is called and after module_exit.
-	 */
-	if (THIS_MODULE->state != MODULE_STATE_LIVE) {
-		rc = -ENODEV;
-		goto out_nodev;
-	}
-#endif
 	rtnl_lock();
 	fcoe = fcoe_hostlist_lookup_port(netdev);
 	rtnl_unlock();
@@ -1844,7 +1821,6 @@ static int fcoe_enable(struct net_device *netdev)
 	else if (!fcoe_link_ok(fcoe->ctlr.lp))
 		fcoe_ctlr_link_up(&fcoe->ctlr);
 
-out_nodev:
 	mutex_unlock(&fcoe_config_mutex);
 	return rc;
 }
@@ -1863,17 +1839,6 @@ static int fcoe_destroy(struct net_device *netdev)
 	int rc = 0;
 
 	mutex_lock(&fcoe_config_mutex);
-#ifdef CONFIG_FCOE_MODULE
-	/*
-	 * Make sure the module has been initialized, and is not about to be
-	 * removed.  Module paramter sysfs files are writable before the
-	 * module_init function is called and after module_exit.
-	 */
-	if (THIS_MODULE->state != MODULE_STATE_LIVE) {
-		rc = -ENODEV;
-		goto out_nodev;
-	}
-#endif
 	rtnl_lock();
 	fcoe = fcoe_hostlist_lookup_port(netdev);
 	if (!fcoe) {
@@ -1938,18 +1903,6 @@ static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode)
 	mutex_lock(&fcoe_config_mutex);
 	rtnl_lock();
 
-#ifdef CONFIG_FCOE_MODULE
-	/*
-	 * Make sure the module has been initialized, and is not about to be
-	 * removed.  Module paramter sysfs files are writable before the
-	 * module_init function is called and after module_exit.
-	 */
-	if (THIS_MODULE->state != MODULE_STATE_LIVE) {
-		rc = -ENODEV;
-		goto out_nodev;
-	}
-#endif
-
 	/* look for existing lport */
 	if (fcoe_hostlist_lookup(netdev)) {
 		rc = -EEXIST;


  parent reply	other threads:[~2011-04-01 23:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-01 23:05 [PATCH 00/11] libfc, libfcoe and fcoe updates for scsi-misc Robert Love
2011-04-01 23:05 ` [PATCH 01/11] libfcoe: Remove mutex_trylock/restart_syscall checks Robert Love
2011-04-01 23:05 ` [PATCH 02/11] fcoe: " Robert Love
2011-04-01 23:06 ` Robert Love [this message]
2011-04-01 23:06 ` [PATCH 04/11] scsi: use list_move() instead of list_del()/list_add() combination Robert Love
2011-04-01 23:06 ` [PATCH 05/11] libfc: Move host_lock usage into ramp_up/down routines Robert Love
2011-04-01 23:06 ` [PATCH 06/11] libfcoe: clean up netdev mapping properly when the transport goes away Robert Love
2011-04-01 23:06 ` [PATCH 07/11] libfcoe: fix possible buffer overflow in fcoe_transport_show Robert Love
2011-04-01 23:06 ` [PATCH 08/11] libfcoe: fix wrong comment in fcoe_transport_detach Robert Love
2011-04-01 23:06 ` [PATCH 09/11] libfc: remove duplicate ema_list init Robert Love
2011-04-01 23:06 ` [PATCH 10/11] libfc: rec tov value and REC_TOV_CONST units usages is incorrect Robert Love
2011-04-01 23:06 ` [PATCH 11/11] fcoe: have fcoe log off and lport destroy before ndo_fcoe_disable 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=20110401230604.15001.56084.stgit@localhost6.localdomain6 \
    --to=robert.w.love@intel.com \
    --cc=James.Bottomley@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ross.b.brattain@intel.com \
    --cc=yi.zou@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