ib_srpt: Made sure that accessing sysfs entries during target creation is harmless.

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2703 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2010-11-14 09:32:03 +00:00
parent a46907c720
commit 83a967d3a3

View File

@@ -2140,6 +2140,9 @@ static int srpt_enable_target(struct scst_tgt *scst_tgt, bool enable)
EXTRACHECKS_WARN_ON_ONCE(irqs_disabled());
if (!sdev)
return -ENOENT;
TRACE_DBG("%s target %s", enable ? "Enabling" : "Disabling",
sdev->device->name);
@@ -2160,6 +2163,9 @@ static bool srpt_is_target_enabled(struct scst_tgt *scst_tgt)
EXTRACHECKS_WARN_ON_ONCE(irqs_disabled());
if (!sdev)
return false;
spin_lock_irq(&sdev->spinlock);
res = sdev->enabled;
spin_unlock_irq(&sdev->spinlock);