summaryrefslogtreecommitdiffstats
path: root/drivers/target/sbp/sbp_target.c
Commit message (Collapse)AuthorAgeFilesLines
* sbp-target: fix error path in sbp_make_tpg()Chris Boot2012-12-121-7/+10
| | | | | | | | | | | | | | If the TPG memory is allocated successfully, but we fail further along in the function, a dangling pointer to freed memory is left in the TPort structure. This is mostly harmless, but does prevent re-trying the operation without first removing the TPort altogether. Reported-by: Chen Gang <gang.chen@asianux.com> Signed-off-by: Chris Boot <bootc@bootc.net> Cc: Andy Grover <agrover@redhat.com> Cc: Nicholas A. Bellinger <nab@linux-iscsi.org> Cc: stable@vger.kernel.org Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* sbp-target: use simple assignment in tgt_agent_rw_agent_state()Chris Boot2012-12-121-3/+4
| | | | | | | | | | | | | | | There is no need to memcpy() a 32-bit integer. The data pointer is guaranteed to be quadlet aligned by the FireWire stack so we can replace the memcpy() with an assignment. Thanks to Stefan Richter. Signed-off-by: Chris Boot <bootc@bootc.net> Cc: Stefan Richter <stefanr@s5r6.in-berlin.de> Cc: Andy Grover <agrover@redhat.com> Cc: Clemens Ladisch <clemens@ladisch.de> Cc: Nicholas A. Bellinger <nab@linux-iscsi.org> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* sbp-target: fix return value check in sbp_register_configfs()Wei Yongjun2012-09-221-2/+2
| | | | | | | | | | | | In case of error, the function target_fabric_configfs_init() returns ERR_PTR() not NULL pointer. The NULL test in the return value check should be replaced with IS_ERR(). dpatch engine is used to auto generated this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: use list_move_tail instead of list_del/list_add_tailWei Yongjun2012-09-171-2/+1
| | | | | | | | | | Using list_move_tail() instead of list_del() + list_add_tail(). spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: Simplify fabric sense data length handlingRoland Dreier2012-09-171-6/+0
| | | | | | | | | | | | | | | | | | | | | | Every fabric driver has to supply a se_tfo->set_fabric_sense_len() method, just so iSCSI can return an offset of 2. However, every fabric driver is already allocating a sense buffer and passing it into the target core, either via transport_init_se_cmd() or target_submit_cmd(). So instead of having iSCSI pass the start of its sense buffer into the core and then later tell the core to skip the first 2 bytes, it seems easier for iSCSI just to do the offset of 2 when it passes the sense buffer into the core. Then we can drop the se_tfo->set_fabric_sense_len() everywhere, and just add a couple of lines of code to iSCSI to set the sense data length to the beginning of the buffer right before it sends it over the network. (nab: Remove .set_fabric_sense_len usage from tcm_qla2xxx_npiv_ops + change transport_get_sense_buffer to follow v3.6-rc6 code w/o ->set_fabric_sense_len usage) Signed-off-by: Roland Dreier <roland@purestorage.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: Remove unused target_core_fabric_ops.get_fabric_sense_len methodRoland Dreier2012-09-171-6/+0
| | | | | | | | There are no callers of se_tfo->get_fabric_sense_len(), so we should stop having every fabric driver implement it. Signed-off-by: Roland Dreier <roland@purestorage.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target/sbp: Remove strict param from sbp_parse_wwnAndy Grover2012-09-171-4/+4
| | | | | | | | | It's always set, and controls whether uppercase A-F are allowed hex values. I don't see a reason not to accept these. Signed-off-by: Andy Grover <agrover@redhat.com> Cc: Chris Boot <bootc@bootc.net> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: Allow for target_submit_cmd() returning errorsRoland Dreier2012-07-171-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | We want it to be possible for target_submit_cmd() to return errors up to its fabric module callers. For now just update the prototype to return an int, and update all callers to handle non-zero return values as an error. This is immediately useful for tcm_qla2xxx to fix a long-standing active I/O session shutdown race, but tcm_fc, usb-gadget, and sbp-target the fabric maintainers need to check + ACK that handling a target_submit_cmd() failure due to session shutdown does not introduce regressions (nab: Respin against for-next after initial NACK + update docbook comment + fix double se_cmd init in exception path for usb-gadget) Cc: Chad Dupuis <chad.dupuis@qlogic.com> Cc: Arun Easi <arun.easi@qlogic.com> Cc: Chris Boot <bootc@bootc.net> Cc: Stefan Richter <stefanr@s5r6.in-berlin.de> Cc: Mark Rustad <mark.d.rustad@intel.com> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Felipe Balbi <balbi@ti.com> Cc: Andy Grover <agrover@redhat.com> Signed-off-by: Roland Dreier <roland@purestorage.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* sbp-target: Consolidate duplicated error path code in sbp_handle_command()Roland Dreier2012-07-161-16/+12
| | | | | | Cc: Chris Boot <bootc@bootc.net> Cc: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Roland Dreier <roland@purestorage.com>
* target: remove transport_generic_process_writeChristoph Hellwig2012-07-161-2/+1
| | | | | | | | Just call target_execute_cmd directly. Also, convert loopback, sbp, usb-gadget to use the newly exported target_execute_cmd(). Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* sbp-target: rename a variable to avoid name clashStefan Richter2012-05-301-4/+4
| | | | | | | | | 'int login_id' shadows 'static atomic_t login_id'. Seen as compilation warning on x86-32. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Acked-by: Chris Boot <bootc@bootc.net> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* sbp-target: Initial merge of firewire/ieee-1394 target mode supportChris Boot2012-05-091-0/+2621
The FireWire SBP-2 Target is a driver for using an IEEE-1394 connection as a SCSI transport. This module uses the SCSI Target framework to expose LUNs to other machines attached to a FireWire bus, in effect acting as a FireWire hard disk similar to FireWire Target Disk mode on many Apple computers. This commit contains the squashed pull from Chris Boot's SBP-2-Target: https://github.com/bootc/Linux-SBP-2-Target.git patch-v3 firewire-sbp-target: Add sbp_base.h header firewire-sbp-target: Add sbp_configfs.c firewire-sbp-target: Add sbp_fabric.{c,h} firewire-sbp-target: Add sbp_management_agent.{c,h} firewire-sbp-target: Add sbp_login.{c,h} firewire-sbp-target: Add sbp_target_agent.{c,h} firewire-sbp-target: Add sbp_scsi_cmnd.{c,h} firewire-sbp-target: Add to target Kconfig and Makefile Also add bootc's entry to the MAINTAINERS file. Great work Chris !! Signed-off-by: Chris Boot <bootc@bootc.net> Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Cc: Andy Grover <agrover@redhat.com> Cc: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>