diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-01-31 17:56:12 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-01-31 18:13:23 -0500 |
commit | faa06ab9aed22f0ad0e15bbf3f80463b5dd7cbe0 (patch) | |
tree | bb1f916cedbe04fff6cfb2b656fb4cbe6f50ea65 /drivers/target | |
parent | 71f1e45aa9974926c3eb511ac488119ed59d7a82 (diff) |
target: Fix regression allowing unconfigured devices to fabric port link
This patch fixes a v3.8-rc1 regression bug where an unconfigured se_device
was incorrectly allowed to perform a fabric port-link. This bug was
introduced in commit:
commit 0fd97ccf45be26fb01b3a412f1f6c6b5044b2f16
Author: Christoph Hellwig <hch@infradead.org>
Date: Mon Oct 8 00:03:19 2012 -0400
target: kill struct se_subsystem_dev
which ended up dropping the original se_subsystem_dev->se_dev_ptr check
preventing this from happening with pre commit 0fd97ccf code.
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_fabric_configfs.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c index 810263dfa4a1..c57bbbc7a7d1 100644 --- a/drivers/target/target_core_fabric_configfs.c +++ b/drivers/target/target_core_fabric_configfs.c | |||
@@ -754,6 +754,11 @@ static int target_fabric_port_link( | |||
754 | return -EFAULT; | 754 | return -EFAULT; |
755 | } | 755 | } |
756 | 756 | ||
757 | if (!(dev->dev_flags & DF_CONFIGURED)) { | ||
758 | pr_err("se_device not configured yet, cannot port link\n"); | ||
759 | return -ENODEV; | ||
760 | } | ||
761 | |||
757 | tpg_ci = &lun_ci->ci_parent->ci_group->cg_item; | 762 | tpg_ci = &lun_ci->ci_parent->ci_group->cg_item; |
758 | se_tpg = container_of(to_config_group(tpg_ci), | 763 | se_tpg = container_of(to_config_group(tpg_ci), |
759 | struct se_portal_group, tpg_group); | 764 | struct se_portal_group, tpg_group); |