target: Add link_magic for fabric allow_link destination target_items
authorNicholas Bellinger <nab@linux-iscsi.org>
Wed, 5 Dec 2012 07:43:57 +0000 (23:43 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Jan 2013 19:45:24 +0000 (11:45 -0800)
commit92a7389317838f3338466df0c0e3d23ad33cb1f4
tree6ccd124313aa8d7abbf16fd5aab09af8d80b8acb
parentced8dfbc6b44c7b14204a13ff95f22bdee52578f
target: Add link_magic for fabric allow_link destination target_items

commit 0ff8754981261a80f4b77db2536dfea92c2d4539 upstream.

This patch adds [dev,lun]_link_magic value assignment + checks within generic
target_fabric_port_link() and target_fabric_mappedlun_link() code to ensure
destination config_item *target_item sent from configfs_symlink() ->
config_item_operations->allow_link() is the underlying se_device->dev_group
and se_lun->lun_group that we expect to symlink.

Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: CAI Qian <caiqian@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/target_core_device.c
drivers/target/target_core_fabric_configfs.c
drivers/target/target_core_tpg.c
drivers/target/target_core_transport.c
include/target/target_core_base.h