aboutsummaryrefslogtreecommitdiff
path: root/drivers/target
AgeCommit message (Collapse)AuthorFilesLines
2014-01-19tcm_loop: Enable DIF/DIX modes in SCSI host LLDNicholas Bellinger1-2/+10
This patch updates tcm_loop_driver_probe() to set protection information using scsi_host_set_prot() and scsi_host_set_guard(), which currently enabled all modes of DIF/DIX protection, minus DIX TYPE0. Also, update tcm_loop_submission_work() to pass struct scsi_cmnd related protection into target_submit_cmd_map_sgls() during CDB dispatch. Reviewed-by: Martin K. Petersen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Or Gerlitz <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-19target/rd: Add DIF protection into rd_execute_rwNicholas Bellinger1-0/+65
This patch adds support for DIF protection into rd_execute_rw() code for WRITE/READ I/O using sbc_dif_verify_[write,read]() logic. It also adds rd_get_prot_table() for locating protection SGLs assoicated with the ramdisk backend device. v2 changes: - Make rd_execute_rw() to u32 sectors count instead of sector_t - Drop SCF_PROT usage Cc: Martin K. Petersen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Or Gerlitz <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-19target/rd: Add support for protection SGL setup + releaseNicholas Bellinger2-0/+78
This patch adds rd_build_prot_space() + rd_release_prot_space() logic to setup + release protection information scatterlists. It also adds rd_init_prot() + rd_free_prot() se_subsystem_api callbacks used by target core code for setup + release of protection information. v2 changes: - Drop unused sg_table from rd_release_prot_space (Wei) - Drop rd_release_prot_space call from rd_free_device Cc: Martin K. Petersen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Or Gerlitz <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-19target/rd: Refactor rd_build_device_space + rd_release_device_spaceNicholas Bellinger1-45/+68
This patch refactors rd_build_device_space() + rd_release_device_space() into rd_allocate_sgl_table() + rd_release_device_space() so that they may be used seperatly for setup + release of protection information scatterlists. Also add explicit memset of pages within rd_allocate_sgl_table() based upon passed 'init_payload' value. v2 changes: - Drop unused sg_table from rd_release_device_space (Wei) Cc: Martin K. Petersen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Or Gerlitz <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-19target/file: Add DIF protection support to fd_execute_rwNicholas Bellinger2-1/+123
This patch adds support for DIF protection into fd_execute_rw() code for WRITE/READ I/O using sbc_dif_verify_[write,read]() logic. It adds fd_do_prot_rw() for handling interface with FILEIO PI, and uses a locally allocated fd_prot->prot_buf + fd_prot->prot_sg for interacting with SBC DIF verify emulation code. Cc: Martin K. Petersen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Or Gerlitz <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-19target/file: Add DIF protection init/format supportNicholas Bellinger2-0/+141
This patch adds support for DIF protection init/format support into the FILEIO backend. It involves using a seperate $FILE.protection for storing PI that is opened via fd_init_prot() using the common pi_prot_type attribute. The actual formatting of the protection is done via fd_format_prot() using the common pi_prot_format attribute, that will populate the initial PI data based upon the currently configured pi_prot_type. Based on original FILEIO code from Sagi. v1 changes: - Fix sparse warnings in fd_init_format_buf (Fengguang) Cc: Martin K. Petersen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Or Gerlitz <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-18target/iblock: Add blk_integrity + BIP passthrough supportNicholas Bellinger2-2/+90
This patch adds blk_integrity passthrough support for block_device backends using IBLOCK. This includes iblock_alloc_bip() + setup of bio_integrity_payload information that attaches to the leading struct bio once bio_list is populated during fast-path iblock_execute_rw() I/O dispatch. It also updates setup in iblock_configure_device() to detect modes of protection + se dev->dev_attrib.pi_prot_type accordingly, along with creating required bio_set integrity mempools. Cc: Martin K. Petersen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Or Gerlitz <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-18target: Add protection SGLs to target_submit_cmd_map_sglsNicholas Bellinger2-3/+15
This patch adds support to target_submit_cmd_map_sgls() for accepting 'sgl_prot' + 'sgl_prot_count' parameters for DIF protection information. Note the passed parameters are stored at se_cmd->t_prot_sg and se_cmd->t_prot_nents respectively. Also, update tcm_loop and vhost-scsi fabrics usage of target_submit_cmd_map_sgls() to take into account the new parameters. Cc: Martin K. Petersen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Or Gerlitz <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-18target/configfs: Expose protection device attributesNicholas Bellinger3-0/+103
This patch adds support for exposing DIF protection device attributes via configfs. This includes: pi_prot_type: Protection Type (0, 1, 3 currently support) pi_prot_format: Protection Format Operation (FILEIO only) Within se_dev_set_pi_prot_type() it also adds the se_subsystem_api device callbacks to setup per device protection information. v2 changes: - Drop pi_guard_type + pi_prot_version related code (MKP) - Add pi_prot_format logic (Sagi) - Add ->free_prot callback in target_free_device - Add hw_pi_prot_type read-only attribute Cc: Martin K. Petersen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Or Gerlitz <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-18target/spc: Expose ATO bit in control mode pageNicholas Bellinger1-0/+13
This patch updates spc_modesense_control() to set the Application Tag Owner (ATO) bit when when DIF emulation is enabled by the backend device. Reviewed-by: Martin K. Petersen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Or Gerlitz <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-18target/sbc: Add P_TYPE + PROT_EN bits to READ_CAPACITY_16Nicholas Bellinger1-0/+5
This patch updates sbc_emulate_readcapacity_16() to set P_TYPE and PROT_EN bits when DIF emulation is enabled by the backend device. Reviewed-by: Martin K. Petersen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Or Gerlitz <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-18target/spc: Add protection related bits to INQUIRY EVPD=0x86Nicholas Bellinger1-0/+9
This patch updates spc_emulate_evpd_86() (extended INQUIRY) to report GRD_CHK (Guard Check) and REF_CHK (Reference Check) bits when DIF emulation is enabled by the backend device. Reviewed-by: Martin K. Petersen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Or Gerlitz <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-18target/spc: Add protection bit to standard INQUIRY outputNicholas Bellinger1-0/+5
This patch updates spc_emulate_inquiry_std() to set the PROTECT bit when DIF emulation is enabled by the backend device. Reviewed-by: Martin K. Petersen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Or Gerlitz <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-18target/sbc: Add DIF TYPE1+TYPE3 read/write verify emulationNicholas Bellinger2-0/+179
This patch adds support for DIF read/write verify emulation for TARGET_DIF_TYPE1_PROT + TARGET_DIF_TYPE3_PROT operation. This includes sbc_dif_verify_write() + sbc_dif_verify_read() calls accessable by backend drivers to perform DIF verify for SGL based data and protection information. Also included is sbc_dif_copy_prot() logic to copy protection information to/from backend provided protection SGLs. Based on scsi_debug.c DIF TYPE1+TYPE3 emulation. v2 changes: - Select CRC_T10DIF for TARGET_CORE in Kconfig (Fengguang) - Drop IP checksum logic from sbc_dif_v1_verify (MKP) - Fix offset on app_tag = 0xffff in sbc_dif_verify_read() Cc: Martin K. Petersen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Or Gerlitz <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-18target/sbc: Add DIF setup in sbc_check_prot + sbc_parse_cdbNicholas Bellinger1-0/+62
This patch adds sbc_check_prot() for performing various DIF related CDB sanity checks, along with setting cmd->prot_type once sanity checks have passed. Also, add calls in sbc_parse_cdb() for READ_[10,12,16] + WRITE_[10,12,16] to perform DIF sanity checking. v2 changes: - Make sbc_check_prot defined as static (Fengguang + Wei) - Remove unprotected READ/WRITE warning (mkp) - Populate cmd->prot_type + friends (Sagi) - Drop SCF_PROT usage Cc: Martin K. Petersen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Or Gerlitz <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-18target: Add DIF CHECK_CONDITION ASC/ASCQ exception casesNicholas Bellinger1-0/+30
This patch adds support for DIF related CHECK_CONDITION ASC/ASCQ exception cases into transport_send_check_condition_and_sense(). This includes: LOGICAL BLOCK GUARD CHECK FAILED LOGICAL BLOCK APPLICATION TAG CHECK FAILED LOGICAL BLOCK REFERENCE TAG CHECK FAILED that used by DIF TYPE1 and TYPE3 failure cases. Cc: Martin K. Petersen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Or Gerlitz <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-09target: Convert inquiry temporary buffer to heap memoryNicholas Bellinger1-3/+8
This patch converts the temporary buffer in spc_emulate_inquiry() to use dynamically allocated memory, instead of local stack memory. Also bump SE_INQUIRY_BUF up to 1024 bytes to be safe when handling multiple large SCSI name descriptors for EVPD=0x83. Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-09target_core_alua: check for buffer overflowHannes Reinecke1-6/+17
When a writing to a command-provided buffer we need to ensure that we're not writing past the end of it. At the same time we need to continue processing as typically the final data length (ie the required size of the buffer) need to be returned. Signed-off-by: Hannes Reinecke <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-09drivers: target: Mark functions and structures as static in tfc_conf.cRashika Kheria1-3/+3
Mark functions ft_tpg_alloc_fabric_acl(), ft_register_configfs() and ft_deregister_configfs() as static in tcm_fc/tfc_conf.c because they are not used outside this file. This eliminates the following warnings in tcm_fc/tfc_conf.c: drivers/target/tcm_fc/tfc_conf.c:270:21: warning: no previous prototype for ‘ft_tpg_alloc_fabric_acl’ [-Wmissing-prototypes] drivers/target/tcm_fc/tfc_conf.c:555:5: warning: no previous prototype for ‘ft_register_configfs’ [-Wmissing-prototypes] drivers/target/tcm_fc/tfc_conf.c:602:6: warning: no previous prototype for ‘ft_deregister_configfs’ [-Wmissing-prototypes] Signed-off-by: Rashika Kheria <[email protected]> Reviewed-by: Josh Triplett <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-09drivers: target: Mark functions as static in tcm_loop.cRashika Kheria1-4/+4
Mark functions tcm_loop_make_naa_tpg(), tcm_loop_drop_naa_tpg(), tcm_loop_make_scsi_hba() and tcm_loop_drop_scsi_hba() as static in loopback/tcm_loop.c because they are not used outside this file. This eliminates the following warning in loopback/tcm_loop.c: drivers/target/loopback/tcm_loop.c:1231:25: warning: no previous prototype for ‘tcm_loop_make_naa_tpg’ [-Wmissing-prototypes] drivers/target/loopback/tcm_loop.c:1276:6: warning: no previous prototype for ‘tcm_loop_drop_naa_tpg’ [-Wmissing-prototypes] drivers/target/loopback/tcm_loop.c:1308:16: warning: no previous prototype for ‘tcm_loop_make_scsi_hba’ [-Wmissing-prototypes] drivers/target/loopback/tcm_loop.c:1378:6: warning: no previous prototype for ‘tcm_loop_drop_scsi_hba’ [-Wmissing-prototypes] Signed-off-by: Rashika Kheria <[email protected]> Reviewed-by: Josh Triplett <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-09drivers: target: Mark function as static in target_core_iblock.cRashika Kheria1-1/+1
Mark function iblock_get_write_cache() as static in target_core_iblock.c because it is not used outside this file. This eliminates the following warning in target_core_iblock.c: drivers/target/target_core_iblock.c:766:6: warning: no previous prototype for ‘iblock_get_write_cache’ [-Wmissing-prototypes] Signed-off-by: Rashika Kheria <[email protected]> Reviewed-by: Josh Triplett <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-09drivers: target: Move prototype declaration of function to header file ↵Rashika Kheria2-4/+5
target_core_pr.h Move prototype declaration of function spc_parse_naa_6h_vendor_specific() from target_core_xcopy.c to header file target_core_pr.h because it is used by more than one file. This eliminates the following warning in target_core_spc.c: drivers/target/target_core_spc.c:138:6: warning: no previous prototype for ‘spc_parse_naa_6h_vendor_specific’ [-Wmissing-prototypes] Signed-off-by: Rashika Kheria <[email protected]> Reviewed-by: Josh Triplett <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-09target_core_alua: Referrals configfs integrationHannes Reinecke5-1/+308
Referrals need an LBA map, which needs to be kept consistent across all target port groups. So instead of tying the map to the target port groups I've implemented a single attribute containing the entire map. Signed-off-by: Hannes Reinecke <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-01-09target_core_alua: Referrals infrastructureHannes Reinecke6-3/+191
Add infrastructure for referrals. v2 changes: - Fix unsigned long long division in core_alua_state_lba_dependent on 32-bit (Fengguang + Chen + Hannes) - Fix compile warning in core_alua_state_lba_dependent (nab) - Convert segment_* + sectors variables in core_alua_state_lba_dependent to u64 (Hannes) Signed-off-by: Hannes Reinecke <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-12-31Merge tag 'v3.13-rc6' into for-3.14/coreJens Axboe7-35/+29
Needed to bring blk-mq uptodate, since changes have been going in since for-3.14/core was established. Fixup merge issues related to the immutable biovec changes. Signed-off-by: Jens Axboe <[email protected]> Conflicts: block/blk-flush.c fs/btrfs/check-integrity.c fs/btrfs/extent_io.c fs/btrfs/scrub.c fs/logfs/dev_bdev.c
2013-12-19target: Remove extra percpu_ref_initAndy Grover1-7/+1
lun->lun_ref is also initialized in core_tpg_post_addlun, so it doesn't need to be done in core_tpg_setup_virtual_lun0. (nab: Drop left-over percpu_ref_cancel_init in failure path) Signed-off-by: Andy Grover <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-12-19target/file: Update hw_max_sectors based on current block_sizeNicholas Bellinger3-5/+13
This patch allows FILEIO to update hw_max_sectors based on the current max_bytes_per_io. This is required because vfs_[writev,readv]() can accept a maximum of 2048 iovecs per call, so the enforced hw_max_sectors really needs to be calculated based on block_size. This addresses a >= v3.5 bug where block_size=512 was rejecting > 1M sized I/O requests, because FD_MAX_SECTORS was hardcoded to 2048 for the block_size=4096 case. (v2: Use max_bytes_per_io instead of ->update_hw_max_sectors) Reported-by: Henrik Goldman <[email protected]> Cc: <[email protected]> #3.5+ Signed-off-by: Nicholas Bellinger <[email protected]>
2013-12-19iscsi-target: Fix incorrect np->np_thread NULL assignmentNicholas Bellinger2-6/+1
When shutting down a target there is a race condition between iscsit_del_np() and __iscsi_target_login_thread(). The latter sets the thread pointer to NULL, and the former tries to issue kthread_stop() on that pointer without any synchronization. This patch moves the np->np_thread NULL assignment into iscsit_del_np(), after kthread_stop() has completed. It also removes the signal_pending() + np_state check, and only exits when kthread_should_stop() is true. Reported-by: Hannes Reinecke <[email protected]> Cc: <[email protected]> #3.12+ Signed-off-by: Nicholas Bellinger <[email protected]>
2013-12-17target_core_spc: Include target device descriptor in VPD page 83Hannes Reinecke1-1/+42
We should be including a descriptor referring to the target device to allow identification of different TCM instances. (nab: Bump SE_INQUIRY_BUF to 1024 bytes to handle 2x 256 byte SCSI names) Signed-off-by: Hannes Reinecke <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-12-17target_core: simplify scsi_name_len calculationHannes Reinecke1-10/+3
scsi_name_len in spc_emulate_evpd_83 is calculated twice, with the results of the first calculation discarded. So remove it. And check for the maximum allowed length, too. Signed-off-by: Hannes Reinecke <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-12-17target_core_alua: Use workqueue for ALUA transitioningHannes Reinecke1-50/+124
Use a workqueue for processing ALUA state transitions; this allows us to process implicit delay properly. Signed-off-by: Hannes Reinecke <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-12-17target_core_alua: store old and pending ALUA stateHannes Reinecke1-5/+10
During state transition we should be storing both the original and the pending state. Signed-off-by: Hannes Reinecke <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-12-17target_core_alua: Allocate ALUA metadata on demandHannes Reinecke2-39/+34
We should only allocate ALUA metadata if we're actually going to write them. Signed-off-by: Hannes Reinecke <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-12-17target_core_alua: validate ALUA state transitionHannes Reinecke1-10/+45
As we now can modify the list of supported states we need to validate the requested ALUA state when doing a state transition. Signed-off-by: Hannes Reinecke <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-12-16target: Don't use void* when passing dev in core_tpg_add_lunAndy Grover2-3/+3
Especially since it's actually a device. Signed-off-by: Andy Grover <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-12-16target: Rename core_tpg_{pre,post}_addlun for clarityAndy Grover3-7/+7
"pre" is really an allocation function. The only time it isn't called is for virtual_lun0, which is statically allocated. Renaming that to "alloc" lets the other function not need to be "post", and just be called core_tpg_add_lun. (nab: fix minor applying fuzz in core_tpg_setup_virtual_lun0) Signed-off-by: Andy Grover <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-12-16target: Refer to u32 luns as unpacked_lunAndy Grover1-8/+8
It's clearer to refer to pointers to the struct se_lun as "lun" and the actual number itself as "unpacked_lun". Signed-off-by: Andy Grover <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-12-16target: Fix sizeof in kmalloc for some default_groups arraysAndy Grover2-2/+2
Allocating an array of pointers, not the objects themselves. These two sites now match all the other sites. Signed-off-by: Andy Grover <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-12-16target: Allocate more room for port default groupsAndy Grover1-1/+1
See target_stat_setup_port_default_groups, we need a 4 element array. Signed-off-by: Andy Grover <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-12-16target: Remove unused ua_dev_list member in struct se_uaAndy Grover1-1/+0
Initialized but not used. Signed-off-by: Andy Grover <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-12-11iscsi-target: Fix-up all zero data-length CDBs with R/W_BIT setNicholas Bellinger1-14/+12
This patch changes special case handling for ISCSI_OP_SCSI_CMD where an initiator sends a zero length Expected Data Transfer Length (EDTL), but still sets the WRITE and/or READ flag bits when no payload transfer is requested. Many, many moons ago two special cases where added for an ancient version of ESX that has long since been fixed, so instead of adding a new special case for the reported bug with a Broadcom 57800 NIC, go ahead and always strip off the incorrect WRITE + READ flag bits. Also, avoid sending a reject here, as RFC-3720 does mandate this case be handled without protocol error. Reported-by: Witold Bazakbal <[email protected]> Tested-by: Witold Bazakbal <[email protected]> Cc: <[email protected]> #3.1+ Signed-off-by: Nicholas Bellinger <[email protected]>
2013-12-11target: Remove write-only stats fields and lock from struct se_node_aclRoland Dreier1-2/+0
Commit 04f3b31bff72 ("iscsi-target: Convert iscsi_session statistics to atomic_long_t") removed the updating of these fields in iscsi (the only fabric driver that ever touched these counters), and the core has no way to report or otherwise use the values. Remove the last remnants of these counters. Signed-off-by: Roland Dreier <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-12-11iscsi-target: return -EINVAL on oversized configfs parameterEric Seppanen1-1/+2
The iSCSI CHAP auth parameters are already copied with respect for the destination buffer size. Return -EINVAL instead of silently truncating the input. Signed-off-by: Eric Seppanen <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-11-23block: Abstract out bvec iteratorKent Overstreet1-1/+1
Immutable biovecs are going to require an explicit iterator. To implement immutable bvecs, a later patch is going to add a bi_bvec_done member to this struct; for now, this patch effectively just renames things. Signed-off-by: Kent Overstreet <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: "Ed L. Cashin" <[email protected]> Cc: Nick Piggin <[email protected]> Cc: Lars Ellenberg <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Geoff Levand <[email protected]> Cc: Yehuda Sadeh <[email protected]> Cc: Sage Weil <[email protected]> Cc: Alex Elder <[email protected]> Cc: [email protected] Cc: Joshua Morris <[email protected]> Cc: Philip Kelleher <[email protected]> Cc: Rusty Russell <[email protected]> Cc: "Michael S. Tsirkin" <[email protected]> Cc: Konrad Rzeszutek Wilk <[email protected]> Cc: Jeremy Fitzhardinge <[email protected]> Cc: Neil Brown <[email protected]> Cc: Alasdair Kergon <[email protected]> Cc: Mike Snitzer <[email protected]> Cc: [email protected] Cc: Martin Schwidefsky <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: [email protected] Cc: Boaz Harrosh <[email protected]> Cc: Benny Halevy <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: "Nicholas A. Bellinger" <[email protected]> Cc: Alexander Viro <[email protected]> Cc: Chris Mason <[email protected]> Cc: "Theodore Ts'o" <[email protected]> Cc: Andreas Dilger <[email protected]> Cc: Jaegeuk Kim <[email protected]> Cc: Steven Whitehouse <[email protected]> Cc: Dave Kleikamp <[email protected]> Cc: Joern Engel <[email protected]> Cc: Prasad Joshi <[email protected]> Cc: Trond Myklebust <[email protected]> Cc: KONISHI Ryusuke <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Joel Becker <[email protected]> Cc: Ben Myers <[email protected]> Cc: [email protected] Cc: Steven Rostedt <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Len Brown <[email protected]> Cc: Pavel Machek <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: Herton Ronaldo Krzesinski <[email protected]> Cc: Ben Hutchings <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Guo Chao <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Asai Thambi S P <[email protected]> Cc: Selvan Mani <[email protected]> Cc: Sam Bradshaw <[email protected]> Cc: Wei Yongjun <[email protected]> Cc: "Roger Pau Monné" <[email protected]> Cc: Jan Beulich <[email protected]> Cc: Stefano Stabellini <[email protected]> Cc: Ian Campbell <[email protected]> Cc: Sebastian Ott <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Jiang Liu <[email protected]> Cc: Nitin Gupta <[email protected]> Cc: Jerome Marchand <[email protected]> Cc: Joe Perches <[email protected]> Cc: Peng Tao <[email protected]> Cc: Andy Adamson <[email protected]> Cc: fanchaoting <[email protected]> Cc: Jie Liu <[email protected]> Cc: Sunil Mushran <[email protected]> Cc: "Martin K. Petersen" <[email protected]> Cc: Namjae Jeon <[email protected]> Cc: Pankaj Kumar <[email protected]> Cc: Dan Magenheimer <[email protected]> Cc: Mel Gorman <[email protected]>6
2013-11-22Merge branch 'for-next' of ↵Linus Torvalds39-646/+824
git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending Pull SCSI target updates from Nicholas Bellinger: "Things have been quiet this round with mostly bugfixes, percpu conversions, and other minor iscsi-target conformance testing changes. The highlights include: - Add demo_mode_discovery attribute for iscsi-target (Thomas) - Convert tcm_fc(FCoE) to use percpu-ida pre-allocation - Add send completion interrupt coalescing for ib_isert - Convert target-core to use percpu-refcounting for se_lun - Fix mutex_trylock usage bug in iscsit_increment_maxcmdsn - tcm_loop updates (Hannes) - target-core ALUA cleanups + prep for v3.14 SCSI Referrals support (Hannes) v3.14 is currently shaping to be a busy development cycle in target land, with initial support for T10 Referrals and T10 DIF currently on the roadmap" * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (40 commits) iscsi-target: chap auth shouldn't match username with trailing garbage iscsi-target: fix extract_param to handle buffer length corner case iscsi-target: Expose default_erl as TPG attribute target_core_configfs: split up ALUA supported states target_core_alua: Make supported states configurable target_core_alua: Store supported ALUA states target_core_alua: Rename ALUA_ACCESS_STATE_OPTIMIZED target_core_alua: spellcheck target core: rename (ex,im)plict -> (ex,im)plicit percpu-refcount: Add percpu-refcount.o to obj-y iscsi-target: Do not reject non-immediate CmdSNs exceeding MaxCmdSN iscsi-target: Convert iscsi_session statistics to atomic_long_t target: Convert se_device statistics to atomic_long_t target: Fix delayed Task Aborted Status (TAS) handling bug iscsi-target: Reject unsupported multi PDU text command sequence ib_isert: Avoid duplicate iscsit_increment_maxcmdsn call iscsi-target: Fix mutex_trylock usage in iscsit_increment_maxcmdsn target: Core does not need blkdev.h target: Pass through I/O topology for block backstores iser-target: Avoid using FRMR for single dma entry requests ...
2013-11-20iscsi-target: chap auth shouldn't match username with trailing garbageEric Seppanen1-1/+4
In iSCSI negotiations with initiator CHAP enabled, usernames with trailing garbage are permitted, because the string comparison only checks the strlen of the configured username. e.g. "usernameXXXXX" will be permitted to match "username". Just check one more byte so the trailing null char is also matched. Signed-off-by: Eric Seppanen <[email protected]> Cc: <[email protected]> #3.1+ Signed-off-by: Nicholas Bellinger <[email protected]>
2013-11-20iscsi-target: fix extract_param to handle buffer length corner caseEric Seppanen1-1/+1
extract_param() is called with max_length set to the total size of the output buffer. It's not safe to allow a parameter length equal to the buffer size as the terminating null would be written one byte past the end of the output buffer. Signed-off-by: Eric Seppanen <[email protected]> Cc: <[email protected]> #3.1+ Signed-off-by: Nicholas Bellinger <[email protected]>
2013-11-20iscsi-target: Expose default_erl as TPG attributeNicholas Bellinger6-7/+36
This patch exposes default_erl as a TPG attribute so that it may be set TPG wide in demo-mode, but still allow the existing NodeACL attribute to be overridden on a per initiator basis. Reported-by: Arshad Hussain <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-11-20target_core_configfs: split up ALUA supported statesHannes Reinecke1-43/+84
Split up the various ALUA states into individual attributes to make parsing easier and adhere to the one value per attribute sysfs principle. (nab: Convert strict_strtoul -> kstrtoul usage) Signed-off-by: Hannes Reinecke <[email protected]>
2013-11-20target_core_alua: Make supported states configurableHannes Reinecke1-0/+50
Signed-off-by: Hannes Reinecke <[email protected]>