{"head":"976d167615b64e14bc1491ca51d424e2ba9a5e84","size":866,"push_id":46363917,"commits":[{"sha":"052605c6caa3e1edf8eee8fe5fe6d53f5721f39a","author":{"name":"Nicholas Bellinger","email":"978acd1567d5598152161fdf8bf3ca568f950c9b@linux-iscsi.org"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/052605c6caa3e1edf8eee8fe5fe6d53f5721f39a","message":"target: Make standard INQUIRY return 'not connected' for tpg_virt_lun0\n\nThis patch changes target_emulate_inquiry_std() to set the 'not connected'\n(0x35) bit in standard INQUIRY response data when we are processing a\nrequest to a virtual LUN=0 mapping from struct se_device *g_lun0_dev that\nhave been setup for us in transport_lookup_cmd_lun().\n\nThis addresses an issue where qla2xxx FC clients need to be able\nto create demo-mode I_T FC Nexuses by default, but should not be\nexposing the default set of TPG LUNs to all FC clients.  This includes\nadding an new optional target_core_fabric_ops->tpg_check_demo_mode_login_only()\ncaller to allow demo_mode nexuses to skip the old default of bulding\na demo-mode MappedLUNs list via core_tpg_add_node_to_devs().\n\n(roland: Add missing tpg_check_demo_mode_login_only check in core_dev_add_lun)\n\nReported-by: Roland Dreier <roland@purestorage.com>\nCc: Andrew Vasquez <andrew.vasquez@qlogic.com>\nSigned-off-by: Nicholas Bellinger <nab@risingtidesystems.com>"},{"sha":"e1750ba20f0d850c38820190ccbf0f647723091a","author":{"name":"Thomas Meyer","email":"5f50a84c1fa3bcff146405017f36aec1a10a9e38@m3y3r.de"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/e1750ba20f0d850c38820190ccbf0f647723091a","message":"target: Use ERR_CAST inlined function\n\nUse ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))\n\nThe semantic patch that makes this output is available\nin scripts/coccinelle/api/err_cast.cocci.\n\nMore information about semantic patching is available at\nhttp://coccinelle.lip6.fr/\n\nSigned-off-by: Thomas Meyer <thomas@m3y3r.de>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>"},{"sha":"9be08c5804ae4ad96ec22d0b1e71e630803a85ea","author":{"name":"Jesper Juhl","email":"7323a5431d1c31072983a6a5bf23745b655ddf59@chaosbits.net"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/9be08c5804ae4ad96ec22d0b1e71e630803a85ea","message":"iscsi-target: Fix leak on failure in iscsi_copy_param_list()\n\nWe leak memory if the allocations for 'new_param->name' or\n'new_param->value' fail in iscsi_target_parameters.c::iscsi_copy_param_list()\n\nWe also do a lot of variable assignments that are completely pointless\nif the allocations fail.\n\nSo, let's move the allocations before the assignments and also make\nsure that we free whatever was allocated to one if the allocation fail.\n\nThere's also some small CodingStyle fixups in there (curly braces on\nboth branches of if statement, only one variable per line) since I was\nin the area anyway. And finally, error messages in the function are\nput on a single line for easy grep'abillity.\n\nSigned-off-by: Jesper Juhl <jj@chaosbits.net>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>"},{"sha":"6fc6148865c9a17cee33f251723f6a056f022ecd","author":{"name":"Julia Lawall","email":"b43b0ad1e8108e7ab870d7a54feac93ae8b8600e@diku.dk"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/6fc6148865c9a17cee33f251723f6a056f022ecd","message":"target: Convert target_core_rd.c to use use BUG_ON\n\nUse BUG_ON(x) rather than if(x) BUG();\n\nThe semantic patch that fixes this problem is as follows:\n(http://coccinelle.lip6.fr/)\n\n// <smpl>\n@@ identifier x; @@\n-if (x) BUG();\n+BUG_ON(x);\n\n@@ identifier x; @@\n-if (!x) BUG();\n+BUG_ON(!x);\n// </smpl>\n\nSigned-off-by: Julia Lawall <julia@diku.dk>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>"},{"sha":"c2337c709102b343bd917ae00c79b266fb15b871","author":{"name":"Dan Carpenter","email":"72501f147b2753e6660fdce744d9ac3084854f5e@gmail.com"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/c2337c709102b343bd917ae00c79b266fb15b871","message":"iscsi-target: remove duplicate return\n\nWe returned on the line before already.\n\nSigned-off-by: Dan Carpenter <error27@gmail.com>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>"},{"sha":"387e96c05299ca7a0ade874f343f91f0b01086a0","author":{"name":"Dan Carpenter","email":"72501f147b2753e6660fdce744d9ac3084854f5e@gmail.com"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/387e96c05299ca7a0ade874f343f91f0b01086a0","message":"iscsi-target: forever loop bug in iscsit_attach_ooo_cmdsn()\n\nThis patch fixes a forever loop bug in iscsit_attach_ooo_cmdsn()\nwhile walking sess->sess_ooo_cmdsn_list when the received\nCmdSN is less than the tail of the list.\n\nSigned-off-by: Dan Carpenter <error27@gmail.com>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>"},{"sha":"16ab8e60a0ebc22cfbe61d84e620457a15f3a0bc","author":{"name":"Nicholas Bellinger","email":"978acd1567d5598152161fdf8bf3ca568f950c9b@linux-iscsi.org"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/16ab8e60a0ebc22cfbe61d84e620457a15f3a0bc","message":"target: Fix write payload exception handling with ->new_cmd_map\n\nThis patch fixes a bug for fabrics using tfo->new_cmd_map() that\nare expect transport_generic_request_failure() to be calling\ntransport_send_check_condition_and_sense() for both READ and WRITE,\ninstead of only for READ exceptions.\n\nThis was originally observed with a failed WRITE_SAME_16 w/ unmap=0\nusing tcm_loop.\n\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>"},{"sha":"706d5860969b3b24d65d9a57bd3bb5e4a1419c08","author":{"name":"Nicholas Bellinger","email":"978acd1567d5598152161fdf8bf3ca568f950c9b@linux-iscsi.org"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/706d5860969b3b24d65d9a57bd3bb5e4a1419c08","message":"target: Add WRITE_SAME (10) parsing and refactor passthrough checks\n\nThis patch adds initial WRITE_SAME (10) w/ UNMAP=1 support following updates in\nsbcr26 to allow UNMAP=1 for the non 16 + 32 byte CDB case.  It also refactors\ncurrent pSCSI passthrough passthrough checks into target_check_write_same_discard()\nahead of UNMAP=0 w/ write payload support into target_core_iblock.c.\n\nThis includes the support for handling WRITE_SAME in transport_emulate_control_cdb(),\nand converts target_emulate_write_same to accept num_blocks directly for\nWRITE_SAME, WRITE_SAME_16 and WRITE_SAME_32.\n\nReported-by: Eric Seppanen <eric@purestorage.com>\nCc: Roland Dreier <roland@purestorage.com>\nCc: Christoph Hellwig <hch@lst.de>\nSigned-off-by: Nicholas Bellinger <nab@risingtidesystems.com>"},{"sha":"12850626e2717f866a94e6ced724e3efe5a0aab8","author":{"name":"Nicholas Bellinger","email":"978acd1567d5598152161fdf8bf3ca568f950c9b@linux-iscsi.org"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/12850626e2717f866a94e6ced724e3efe5a0aab8","message":"target: Fix WRITE_SAME usage with transport_get_size\n\nFor all flavours of WRITE_SAME, we only expect to handle a single block\nof data-out buffer payload, regardless of the number of logical blocks\npresented in the CDB.  This patch changes all flavours of WRITE_SAME in\ntransport_generic_cmd_sequencer() to pass '1' into transport_get_size()\ninstead of the extracted 'sectors' to properly handle the default usage\nof sg_write_same without the --xferlen parameter.\n\nReported-by: Eric Seppanen <eric@purestorage.com>\nSigned-off-by: Nicholas Bellinger <nab@risingtidesystems.com>"},{"sha":"72f4ba1e32a1e5da31dcf14ea4b8985ae88a8bdb","author":{"name":"Nicholas Bellinger","email":"978acd1567d5598152161fdf8bf3ca568f950c9b@linux-iscsi.org"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/72f4ba1e32a1e5da31dcf14ea4b8985ae88a8bdb","message":"target: Remove duplicate task completions in transport_emulate_control_cdb\n\nThis patch removes a duplicate set of transport_complete_task() calls in\ntarget_emulate_unmap() and target_emulate_write_same() as the completion\ncall is already done within transport_emulate_control_cdb()\n\nThis patch also adds a check in transport_emulate_control_cdb() for the\nexisting SCF_EMULATE_CDB_ASYNC flag currently used by SYNCHRONIZE_CACHE\nin order to handle IMMEDIATE processing.\n\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>"},{"sha":"7abbe7f3e4243e28a9169ee1b8d76f10a6f5d37c","author":{"name":"Nicholas Bellinger","email":"978acd1567d5598152161fdf8bf3ca568f950c9b@linux-iscsi.org"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/7abbe7f3e4243e28a9169ee1b8d76f10a6f5d37c","message":"target: Fix SYNCHRONIZE_CACHE zero LBA + range breakage\n\nThis patch fixes a SYNCHRONIZE_CACHE CDB handling bug with IBLOCK/FILEIO\nbackends where transport_cmd_get_valid_sectors() was incorrectly rejecting\na zero LBA + range CDB from being processed, and returning CHECK_CONDITION.\n\nThis includes changing transport_cmd_get_valid_sectors() to return '0' on\nsuccess and '-EINVAL' on failure (this makes more sense than sectors),\nand to only check transport_cmd_get_valid_sectors() when a non zero LBA +\nrange SYNCHRONIZE_CACHE operation has been receieved for the non passthrough\ncase.\n\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>"},{"sha":"01cde4d54327884a0b61ce8666092f5703557d4b","author":{"name":"Nicholas Bellinger","email":"978acd1567d5598152161fdf8bf3ca568f950c9b@linux-iscsi.org"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/01cde4d54327884a0b61ce8666092f5703557d4b","message":"target: Add missing DATA_SG_IO transport_cmd_get_valid_sectors check\n\nThis patch adds the missing transport_cmd_get_valid_sectors() check for\nSCF_SCSI_DATA_SG_IO_CDB type payloads to ensure that a received LBA + range\ndoes not exeed past the end of associated backend struct se_device.\n\nThis patch also fixes a bug in the failure path of transport_new_cmd_obj()\nwhere this check can fail, so change to use a signed 'rc' and return '-EINVAL'\nto signal proper transport_generic_request_failure() handling.\n\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>"},{"sha":"525a48a21da259d00d6ebc5b60563b5bcf022c26","author":{"name":"Nicholas Bellinger","email":"978acd1567d5598152161fdf8bf3ca568f950c9b@linux-iscsi.org"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/525a48a21da259d00d6ebc5b60563b5bcf022c26","message":"target: Fix task count > 1 handling breakage and use max_sector page alignment\n\nThis patch addresses recent breakage with multiple se_task (task_count > 1)\noperation following backend dev->se_sub_dev->se_dev_attrib.max_sectors in new\ntransport_allocate_data_tasks() code.  The initial bug here was a bogus\ntask->task_sg_nents assignment in transport_allocate_data_tasks() based on\nthe passed parameter, which now uses DIV_ROUND_UP(task_size, PAGE_SIZE) to\ndetermine the proper number of per task SGL entries for the (task_count > 1)\ncase.\n\nThis also means we now need to enforce a PAGE_SIZE aligned max_sector count\nvalue for this to work as expected without bringing back the pre v3.1\ntransport_map_mem_to_sg() logic to handle SGL offsets across multiple tasks.\nSo this patch adds se_dev_align_max_sectors() to round down max_sectors as\nnecessary to ensure this alignment via se_dev_set_default_attribs() and\nse_dev_align_max_sectors() and keeps it simple for (task_count > 1)\noperation.\n\nSo far this bugfix has been tested with (task_count > 1) operation\nusing iscsi-target and iblock backends.\n\nReported-by: Chris Boot <bootc@bootc.net>\nCc: Kiran Patil <kiran.patil@intel.com>\nCc: Andy Grover <agrover@redhat.com>\nCc: Christoph Hellwig <hch@lst.de>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>"},{"sha":"c3c74c7a33d837be391ab61aaae39bb21f16736a","author":{"name":"Nicholas Bellinger","email":"978acd1567d5598152161fdf8bf3ca568f950c9b@linux-iscsi.org"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/c3c74c7a33d837be391ab61aaae39bb21f16736a","message":"target: Fix task SGL chaining breakage with transport_allocate_data_tasks\n\nThis patch fixes two bugs associated with transport_do_task_sg_chain()\noperation where transport_allocate_data_tasks() was incorrectly setting\ntask_padded_sg for all tasks, and causing bogus task->task_sg_nents\nassignments + OOPsen with fabrics depending upon this code.  The first bit\nhere adds a task_sg_nents_padded check in transport_allocate_data_tasks()\nto include an extra SGL vector when necessary for tasks that expect to\nbe linked using sg_chain().\n\nThe second change involves making transport_do_task_sg_chain() properly\naccount for the extra SGL vector when task->task_padded_sg is set for\nthe non trailing ->task_sg or single ->task_sg allocations.  Note this\npatch also removes the BUG_ON(!task->task_padded_sg) check within\ntransport_do_task_sg_chain() as we expect this to happen normally\nwith the updated logic in transport_allocate_data_tasks(), along with\nbeing bogus for CONTROL_SG_IO_CDB type payloads.\n\nSo far this bugfix has been tested with tcm_qla2xxx and iblock backends\nin (task_count > 1)( and (task_count == 1) operation.\n\nReported-by: Kiran Patil <kiran.patil@intel.com>\nCc: Kiran Patil <kiran.patil@intel.com>\nCc: Andy Grover <agrover@redhat.com>\nCc: Christoph Hellwig <hch@lst.de>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>"},{"sha":"6626a0572657a0945a7b9ccf4a6d6ad1750f9adc","author":{"name":"Chris Boot","email":"a0d620e28662dc0599e9ae5214798aa22d3e3380@bootc.net"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/6626a0572657a0945a7b9ccf4a6d6ad1750f9adc","message":"iscsi-target: Implement iSCSI target IPv6 address printing.\n\nThe iSCSI target configfs code to print out an initiator's IPv6 address\nis not fully implemented. This patch uses snprintf() with the \"%pI6c\"\nformat string to format the IPv6 address for display purposes.\n\nSigned-off-by: Chris Boot <bootc@bootc.net>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>"},{"sha":"ba7736696341ad4253125055c0c85aa9f42959a0","author":{"name":"Dan Carpenter","email":"72501f147b2753e6660fdce744d9ac3084854f5e@gmail.com"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/ba7736696341ad4253125055c0c85aa9f42959a0","message":"iscsi-target: Fix iscsit_allocate_se_cmd_for_tmr failure path bugs\n\nThis patch fixes two bugs in allocation failure handling in\niscsit_allocate_se_cmd_for_tmr():\n\nThis first reported by DanC is a free-after call to transport_free_se_cmd(), this\npatch drops the transport_free_se_cmd() call all together, as iscsit_release_cmd()\nwill release existing allocations as expected.\n\nThe second is a bug where iscsi_cmd_t was being leaked on a cmd->tmr_req allocation\nfailure, so make this jump to iscsit_release_cmd() as well.\n\nSigned-off-by: Dan Carpenter <error27@gmail.com>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>"},{"sha":"f15ea5780d08e4c96930c0d607d05e480ec588c8","author":{"name":"Roland Dreier","email":"0d270388f2f92757a5de0f4bd891d3b392c44c4f@purestorage.com"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/f15ea5780d08e4c96930c0d607d05e480ec588c8","message":"target: Print subpage too for unhandled MODE SENSE pages\n\nMake a log message more useful by printing both the page and subpage\nthat an initiator is requesting.\n\nSigned-off-by: Roland Dreier <roland@purestorage.com>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>"},{"sha":"4e0f05297ff615a9a4e269da301ff77f660a3ab0","author":{"name":"Roland Dreier","email":"0d270388f2f92757a5de0f4bd891d3b392c44c4f@purestorage.com"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/4e0f05297ff615a9a4e269da301ff77f660a3ab0","message":"tcm_fc: init/exit functions should not be protected by \"#ifdef MODULE\"\n\nThere's no need for the #ifdef protection when building into the kernel,\nand in fact we need the module_init() for the initialization function to\nbe called.\n\nSigned-off-by: Roland Dreier <roland@purestorage.com>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>"},{"sha":"e63a8e1933a2218cf801e46dd01bd8cca4a555ec","author":{"name":"Roland Dreier","email":"0d270388f2f92757a5de0f4bd891d3b392c44c4f@purestorage.com"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/e63a8e1933a2218cf801e46dd01bd8cca4a555ec","message":"target: Make locking in transport_deregister_session() IRQ safe\n\nAt least the tcm_qla2xxx fabric driver calls into transport_deregister_session()\nwhile holding an IRQ-disabled spinlock, so the inner locking needs to\nuse spin_lock_irqsave() instead of spin_lock_bh().\n\nThis fixes warnings seen with tcm_qla2xxx like:\n\n    WARNING: at kernel/softirq.c:159 local_bh_enable_ip+0x98/0xb0()\n    Call Trace:\n     [<ffffffff8104e65f>] warn_slowpath_common+0x7f/0xc0\n     [<ffffffff8104e6ba>] warn_slowpath_null+0x1a/0x20\n     [<ffffffff81055368>] local_bh_enable_ip+0x98/0xb0\n     [<ffffffff814d5284>] _raw_spin_unlock_bh+0x14/0x20\n     [<ffffffffa027b7f6>] transport_deregister_session+0x96/0x180 [target_core_mod]\n     [<ffffffffa00f7731>] tcm_qla2xxx_free_session+0xd1/0x170 [tcm_qla2xxx]\n     [<ffffffffa01b9173>] qla_tgt_sess_put+0xc3/0x140 [qla2xxx]\n     [<ffffffffa01bf40f>] qla_tgt_stop_phase1+0x8f/0x2c0 [qla2xxx]\n     [<ffffffffa00f735e>] tcm_qla2xxx_tpg_store_enable+0x6e/0xd0 [tcm_qla2xxx]\n     [<ffffffffa026ca29>] target_fabric_tpg_attr_store+0x39/0x40 [target_core_mod]\n     [<ffffffffa00a575d>] configfs_write_file+0xbd/0x120 [configfs]\n     [<ffffffff811464a6>] vfs_write+0xc6/0x180\n     [<ffffffff811467c1>] sys_write+0x51/0x90\n     [<ffffffff814dd382>] system_call_fastpath+0x16/0x1b\n\nSigned-off-by: Roland Dreier <roland@purestorage.com>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>"},{"sha":"28638887f351d11867562322b7abaa014dd5528a","author":{"name":"Roland Dreier","email":"0d270388f2f92757a5de0f4bd891d3b392c44c4f@purestorage.com"},"url":"https://api.github.com/repos/schandinat/linux-2.6/commits/28638887f351d11867562322b7abaa014dd5528a","message":"target: Convert acl_node_lock to be IRQ-disabling\n\nWith qla2xxx, acl_node_lock is taken inside qla2xxx's hardware_lock,\nwhich is taken in hardirq context.  This means acl_node_lock must become\nan IRQ-disabling lock; in particular this fixes lockdep warnings along\nthe lines of\n\n    ======================================================\n    [ INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected ]\n\n     (&(&se_tpg->acl_node_lock)->rlock){+.....}, at: [<ffffffffa026f872>] transport_deregister_session+0x92/0x140 [target_core_mod]\n\n    and this task is already holding:\n     (&(&ha->hardware_lock)->rlock){-.-...}, at: [<ffffffffa017c5e7>] qla_tgt_stop_phase1+0x57/0x2c0 [qla2xxx]\n    which would create a new lock dependency:\n     (&(&ha->hardware_lock)->rlock){-.-...} -> (&(&se_tpg->acl_node_lock)->rlock){+.....}\n\n    but this new dependency connects a HARDIRQ-irq-safe lock:\n     (&(&ha->hardware_lock)->rlock){-.-...}\n\n    to a HARDIRQ-irq-unsafe lock:\n     (&(&se_tpg->acl_node_lock)->rlock){+.....}\n\nSigned-off-by: Roland Dreier <roland@purestorage.com>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>"}],"ref":"refs/heads/master","legacy":{"head":"976d167615b64e14bc1491ca51d424e2ba9a5e84","size":866,"push_id":46363917,"shas":[["052605c6caa3e1edf8eee8fe5fe6d53f5721f39a","nab@linux-iscsi.org","target: Make standard INQUIRY return 'not connected' for tpg_virt_lun0\n\nThis patch changes target_emulate_inquiry_std() to set the 'not connected'\n(0x35) bit in standard INQUIRY response data when we are processing a\nrequest to a virtual LUN=0 mapping from struct se_device *g_lun0_dev that\nhave been setup for us in transport_lookup_cmd_lun().\n\nThis addresses an issue where qla2xxx FC clients need to be able\nto create demo-mode I_T FC Nexuses by default, but should not be\nexposing the default set of TPG LUNs to all FC clients.  This includes\nadding an new optional target_core_fabric_ops->tpg_check_demo_mode_login_only()\ncaller to allow demo_mode nexuses to skip the old default of bulding\na demo-mode MappedLUNs list via core_tpg_add_node_to_devs().\n\n(roland: Add missing tpg_check_demo_mode_login_only check in core_dev_add_lun)\n\nReported-by: Roland Dreier <roland@purestorage.com>\nCc: Andrew Vasquez <andrew.vasquez@qlogic.com>\nSigned-off-by: Nicholas Bellinger <nab@risingtidesystems.com>","Nicholas Bellinger"],["e1750ba20f0d850c38820190ccbf0f647723091a","thomas@m3y3r.de","target: Use ERR_CAST inlined function\n\nUse ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))\n\nThe semantic patch that makes this output is available\nin scripts/coccinelle/api/err_cast.cocci.\n\nMore information about semantic patching is available at\nhttp://coccinelle.lip6.fr/\n\nSigned-off-by: Thomas Meyer <thomas@m3y3r.de>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>","Thomas Meyer"],["9be08c5804ae4ad96ec22d0b1e71e630803a85ea","jj@chaosbits.net","iscsi-target: Fix leak on failure in iscsi_copy_param_list()\n\nWe leak memory if the allocations for 'new_param->name' or\n'new_param->value' fail in iscsi_target_parameters.c::iscsi_copy_param_list()\n\nWe also do a lot of variable assignments that are completely pointless\nif the allocations fail.\n\nSo, let's move the allocations before the assignments and also make\nsure that we free whatever was allocated to one if the allocation fail.\n\nThere's also some small CodingStyle fixups in there (curly braces on\nboth branches of if statement, only one variable per line) since I was\nin the area anyway. And finally, error messages in the function are\nput on a single line for easy grep'abillity.\n\nSigned-off-by: Jesper Juhl <jj@chaosbits.net>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>","Jesper Juhl"],["6fc6148865c9a17cee33f251723f6a056f022ecd","julia@diku.dk","target: Convert target_core_rd.c to use use BUG_ON\n\nUse BUG_ON(x) rather than if(x) BUG();\n\nThe semantic patch that fixes this problem is as follows:\n(http://coccinelle.lip6.fr/)\n\n// <smpl>\n@@ identifier x; @@\n-if (x) BUG();\n+BUG_ON(x);\n\n@@ identifier x; @@\n-if (!x) BUG();\n+BUG_ON(!x);\n// </smpl>\n\nSigned-off-by: Julia Lawall <julia@diku.dk>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>","Julia Lawall"],["c2337c709102b343bd917ae00c79b266fb15b871","error27@gmail.com","iscsi-target: remove duplicate return\n\nWe returned on the line before already.\n\nSigned-off-by: Dan Carpenter <error27@gmail.com>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>","Dan Carpenter"],["387e96c05299ca7a0ade874f343f91f0b01086a0","error27@gmail.com","iscsi-target: forever loop bug in iscsit_attach_ooo_cmdsn()\n\nThis patch fixes a forever loop bug in iscsit_attach_ooo_cmdsn()\nwhile walking sess->sess_ooo_cmdsn_list when the received\nCmdSN is less than the tail of the list.\n\nSigned-off-by: Dan Carpenter <error27@gmail.com>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>","Dan Carpenter"],["16ab8e60a0ebc22cfbe61d84e620457a15f3a0bc","nab@linux-iscsi.org","target: Fix write payload exception handling with ->new_cmd_map\n\nThis patch fixes a bug for fabrics using tfo->new_cmd_map() that\nare expect transport_generic_request_failure() to be calling\ntransport_send_check_condition_and_sense() for both READ and WRITE,\ninstead of only for READ exceptions.\n\nThis was originally observed with a failed WRITE_SAME_16 w/ unmap=0\nusing tcm_loop.\n\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>","Nicholas Bellinger"],["706d5860969b3b24d65d9a57bd3bb5e4a1419c08","nab@linux-iscsi.org","target: Add WRITE_SAME (10) parsing and refactor passthrough checks\n\nThis patch adds initial WRITE_SAME (10) w/ UNMAP=1 support following updates in\nsbcr26 to allow UNMAP=1 for the non 16 + 32 byte CDB case.  It also refactors\ncurrent pSCSI passthrough passthrough checks into target_check_write_same_discard()\nahead of UNMAP=0 w/ write payload support into target_core_iblock.c.\n\nThis includes the support for handling WRITE_SAME in transport_emulate_control_cdb(),\nand converts target_emulate_write_same to accept num_blocks directly for\nWRITE_SAME, WRITE_SAME_16 and WRITE_SAME_32.\n\nReported-by: Eric Seppanen <eric@purestorage.com>\nCc: Roland Dreier <roland@purestorage.com>\nCc: Christoph Hellwig <hch@lst.de>\nSigned-off-by: Nicholas Bellinger <nab@risingtidesystems.com>","Nicholas Bellinger"],["12850626e2717f866a94e6ced724e3efe5a0aab8","nab@linux-iscsi.org","target: Fix WRITE_SAME usage with transport_get_size\n\nFor all flavours of WRITE_SAME, we only expect to handle a single block\nof data-out buffer payload, regardless of the number of logical blocks\npresented in the CDB.  This patch changes all flavours of WRITE_SAME in\ntransport_generic_cmd_sequencer() to pass '1' into transport_get_size()\ninstead of the extracted 'sectors' to properly handle the default usage\nof sg_write_same without the --xferlen parameter.\n\nReported-by: Eric Seppanen <eric@purestorage.com>\nSigned-off-by: Nicholas Bellinger <nab@risingtidesystems.com>","Nicholas Bellinger"],["72f4ba1e32a1e5da31dcf14ea4b8985ae88a8bdb","nab@linux-iscsi.org","target: Remove duplicate task completions in transport_emulate_control_cdb\n\nThis patch removes a duplicate set of transport_complete_task() calls in\ntarget_emulate_unmap() and target_emulate_write_same() as the completion\ncall is already done within transport_emulate_control_cdb()\n\nThis patch also adds a check in transport_emulate_control_cdb() for the\nexisting SCF_EMULATE_CDB_ASYNC flag currently used by SYNCHRONIZE_CACHE\nin order to handle IMMEDIATE processing.\n\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>","Nicholas Bellinger"],["7abbe7f3e4243e28a9169ee1b8d76f10a6f5d37c","nab@linux-iscsi.org","target: Fix SYNCHRONIZE_CACHE zero LBA + range breakage\n\nThis patch fixes a SYNCHRONIZE_CACHE CDB handling bug with IBLOCK/FILEIO\nbackends where transport_cmd_get_valid_sectors() was incorrectly rejecting\na zero LBA + range CDB from being processed, and returning CHECK_CONDITION.\n\nThis includes changing transport_cmd_get_valid_sectors() to return '0' on\nsuccess and '-EINVAL' on failure (this makes more sense than sectors),\nand to only check transport_cmd_get_valid_sectors() when a non zero LBA +\nrange SYNCHRONIZE_CACHE operation has been receieved for the non passthrough\ncase.\n\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>","Nicholas Bellinger"],["01cde4d54327884a0b61ce8666092f5703557d4b","nab@linux-iscsi.org","target: Add missing DATA_SG_IO transport_cmd_get_valid_sectors check\n\nThis patch adds the missing transport_cmd_get_valid_sectors() check for\nSCF_SCSI_DATA_SG_IO_CDB type payloads to ensure that a received LBA + range\ndoes not exeed past the end of associated backend struct se_device.\n\nThis patch also fixes a bug in the failure path of transport_new_cmd_obj()\nwhere this check can fail, so change to use a signed 'rc' and return '-EINVAL'\nto signal proper transport_generic_request_failure() handling.\n\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>","Nicholas Bellinger"],["525a48a21da259d00d6ebc5b60563b5bcf022c26","nab@linux-iscsi.org","target: Fix task count > 1 handling breakage and use max_sector page alignment\n\nThis patch addresses recent breakage with multiple se_task (task_count > 1)\noperation following backend dev->se_sub_dev->se_dev_attrib.max_sectors in new\ntransport_allocate_data_tasks() code.  The initial bug here was a bogus\ntask->task_sg_nents assignment in transport_allocate_data_tasks() based on\nthe passed parameter, which now uses DIV_ROUND_UP(task_size, PAGE_SIZE) to\ndetermine the proper number of per task SGL entries for the (task_count > 1)\ncase.\n\nThis also means we now need to enforce a PAGE_SIZE aligned max_sector count\nvalue for this to work as expected without bringing back the pre v3.1\ntransport_map_mem_to_sg() logic to handle SGL offsets across multiple tasks.\nSo this patch adds se_dev_align_max_sectors() to round down max_sectors as\nnecessary to ensure this alignment via se_dev_set_default_attribs() and\nse_dev_align_max_sectors() and keeps it simple for (task_count > 1)\noperation.\n\nSo far this bugfix has been tested with (task_count > 1) operation\nusing iscsi-target and iblock backends.\n\nReported-by: Chris Boot <bootc@bootc.net>\nCc: Kiran Patil <kiran.patil@intel.com>\nCc: Andy Grover <agrover@redhat.com>\nCc: Christoph Hellwig <hch@lst.de>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>","Nicholas Bellinger"],["c3c74c7a33d837be391ab61aaae39bb21f16736a","nab@linux-iscsi.org","target: Fix task SGL chaining breakage with transport_allocate_data_tasks\n\nThis patch fixes two bugs associated with transport_do_task_sg_chain()\noperation where transport_allocate_data_tasks() was incorrectly setting\ntask_padded_sg for all tasks, and causing bogus task->task_sg_nents\nassignments + OOPsen with fabrics depending upon this code.  The first bit\nhere adds a task_sg_nents_padded check in transport_allocate_data_tasks()\nto include an extra SGL vector when necessary for tasks that expect to\nbe linked using sg_chain().\n\nThe second change involves making transport_do_task_sg_chain() properly\naccount for the extra SGL vector when task->task_padded_sg is set for\nthe non trailing ->task_sg or single ->task_sg allocations.  Note this\npatch also removes the BUG_ON(!task->task_padded_sg) check within\ntransport_do_task_sg_chain() as we expect this to happen normally\nwith the updated logic in transport_allocate_data_tasks(), along with\nbeing bogus for CONTROL_SG_IO_CDB type payloads.\n\nSo far this bugfix has been tested with tcm_qla2xxx and iblock backends\nin (task_count > 1)( and (task_count == 1) operation.\n\nReported-by: Kiran Patil <kiran.patil@intel.com>\nCc: Kiran Patil <kiran.patil@intel.com>\nCc: Andy Grover <agrover@redhat.com>\nCc: Christoph Hellwig <hch@lst.de>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>","Nicholas Bellinger"],["6626a0572657a0945a7b9ccf4a6d6ad1750f9adc","bootc@bootc.net","iscsi-target: Implement iSCSI target IPv6 address printing.\n\nThe iSCSI target configfs code to print out an initiator's IPv6 address\nis not fully implemented. This patch uses snprintf() with the \"%pI6c\"\nformat string to format the IPv6 address for display purposes.\n\nSigned-off-by: Chris Boot <bootc@bootc.net>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>","Chris Boot"],["ba7736696341ad4253125055c0c85aa9f42959a0","error27@gmail.com","iscsi-target: Fix iscsit_allocate_se_cmd_for_tmr failure path bugs\n\nThis patch fixes two bugs in allocation failure handling in\niscsit_allocate_se_cmd_for_tmr():\n\nThis first reported by DanC is a free-after call to transport_free_se_cmd(), this\npatch drops the transport_free_se_cmd() call all together, as iscsit_release_cmd()\nwill release existing allocations as expected.\n\nThe second is a bug where iscsi_cmd_t was being leaked on a cmd->tmr_req allocation\nfailure, so make this jump to iscsit_release_cmd() as well.\n\nSigned-off-by: Dan Carpenter <error27@gmail.com>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>","Dan Carpenter"],["f15ea5780d08e4c96930c0d607d05e480ec588c8","roland@purestorage.com","target: Print subpage too for unhandled MODE SENSE pages\n\nMake a log message more useful by printing both the page and subpage\nthat an initiator is requesting.\n\nSigned-off-by: Roland Dreier <roland@purestorage.com>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>","Roland Dreier"],["4e0f05297ff615a9a4e269da301ff77f660a3ab0","roland@purestorage.com","tcm_fc: init/exit functions should not be protected by \"#ifdef MODULE\"\n\nThere's no need for the #ifdef protection when building into the kernel,\nand in fact we need the module_init() for the initialization function to\nbe called.\n\nSigned-off-by: Roland Dreier <roland@purestorage.com>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>","Roland Dreier"],["e63a8e1933a2218cf801e46dd01bd8cca4a555ec","roland@purestorage.com","target: Make locking in transport_deregister_session() IRQ safe\n\nAt least the tcm_qla2xxx fabric driver calls into transport_deregister_session()\nwhile holding an IRQ-disabled spinlock, so the inner locking needs to\nuse spin_lock_irqsave() instead of spin_lock_bh().\n\nThis fixes warnings seen with tcm_qla2xxx like:\n\n    WARNING: at kernel/softirq.c:159 local_bh_enable_ip+0x98/0xb0()\n    Call Trace:\n     [<ffffffff8104e65f>] warn_slowpath_common+0x7f/0xc0\n     [<ffffffff8104e6ba>] warn_slowpath_null+0x1a/0x20\n     [<ffffffff81055368>] local_bh_enable_ip+0x98/0xb0\n     [<ffffffff814d5284>] _raw_spin_unlock_bh+0x14/0x20\n     [<ffffffffa027b7f6>] transport_deregister_session+0x96/0x180 [target_core_mod]\n     [<ffffffffa00f7731>] tcm_qla2xxx_free_session+0xd1/0x170 [tcm_qla2xxx]\n     [<ffffffffa01b9173>] qla_tgt_sess_put+0xc3/0x140 [qla2xxx]\n     [<ffffffffa01bf40f>] qla_tgt_stop_phase1+0x8f/0x2c0 [qla2xxx]\n     [<ffffffffa00f735e>] tcm_qla2xxx_tpg_store_enable+0x6e/0xd0 [tcm_qla2xxx]\n     [<ffffffffa026ca29>] target_fabric_tpg_attr_store+0x39/0x40 [target_core_mod]\n     [<ffffffffa00a575d>] configfs_write_file+0xbd/0x120 [configfs]\n     [<ffffffff811464a6>] vfs_write+0xc6/0x180\n     [<ffffffff811467c1>] sys_write+0x51/0x90\n     [<ffffffff814dd382>] system_call_fastpath+0x16/0x1b\n\nSigned-off-by: Roland Dreier <roland@purestorage.com>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>","Roland Dreier"],["28638887f351d11867562322b7abaa014dd5528a","roland@purestorage.com","target: Convert acl_node_lock to be IRQ-disabling\n\nWith qla2xxx, acl_node_lock is taken inside qla2xxx's hardware_lock,\nwhich is taken in hardirq context.  This means acl_node_lock must become\nan IRQ-disabling lock; in particular this fixes lockdep warnings along\nthe lines of\n\n    ======================================================\n    [ INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected ]\n\n     (&(&se_tpg->acl_node_lock)->rlock){+.....}, at: [<ffffffffa026f872>] transport_deregister_session+0x92/0x140 [target_core_mod]\n\n    and this task is already holding:\n     (&(&ha->hardware_lock)->rlock){-.-...}, at: [<ffffffffa017c5e7>] qla_tgt_stop_phase1+0x57/0x2c0 [qla2xxx]\n    which would create a new lock dependency:\n     (&(&ha->hardware_lock)->rlock){-.-...} -> (&(&se_tpg->acl_node_lock)->rlock){+.....}\n\n    but this new dependency connects a HARDIRQ-irq-safe lock:\n     (&(&ha->hardware_lock)->rlock){-.-...}\n\n    to a HARDIRQ-irq-unsafe lock:\n     (&(&se_tpg->acl_node_lock)->rlock){+.....}\n\nSigned-off-by: Roland Dreier <roland@purestorage.com>\nSigned-off-by: Nicholas Bellinger <nab@linux-iscsi.org>","Roland Dreier"]],"ref":"refs/heads/master"}}