Re: [PATCH 2/2] target: Fix target_wait_for_sess_cmds breakage with active signals

2018-10-10 Thread Nicholas A. Bellinger
Hello MNC & Co, On Wed, 2018-10-10 at 11:58 -0500, Mike Christie wrote: > On 10/09/2018 10:23 PM, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > With the addition of commit 00d909a107 in v4.19-rc, it incorrectly assumes > > no > > si

Re: [PATCH 2/2] target: Fix target_wait_for_sess_cmds breakage with active signals

2018-10-10 Thread Nicholas A. Bellinger
Hey Peter & Co, On Wed, 2018-10-10 at 10:43 +0200, Peter Zijlstra wrote: > On Wed, Oct 10, 2018 at 03:23:10AM +, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > With the addition of commit 00d909a107 in v4.19-rc, it incorrectly assumes > >

[GIT PULL] target updates for v4.16-rc1

2018-02-09 Thread Nicholas A. Bellinger
Hi Linus, Here are the target-pending updates for v4.16-rc1. Please go ahead and pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git for-next The highlights include: - Numerous target-core-user improvements related to queue full and timeout handling. (MNC) -

Re: [PATCH target-pending] iscsi-target: make sure to wake up sleeping login worker

2018-01-23 Thread Nicholas A. Bellinger
Hey Florian & Co, On Fri, 2018-01-19 at 18:26 +0100, Florian Westphal wrote: > Eric Dumazet wrote: > > On Fri, 2018-01-19 at 14:36 +0100, Florian Westphal wrote: > > > diff --git a/drivers/target/iscsi/iscsi_target_nego.c > > > b/drivers/target/iscsi/iscsi_target_nego.c

Re: [PATCH] tcmu: Fix trailing semicolon

2018-01-18 Thread Nicholas A. Bellinger
On Tue, 2018-01-16 at 10:25 -0600, Michael Christie wrote: > On 01/16/2018 09:34 AM, Luis de Bethencourt wrote: > > The trailing semicolon is an empty statement that does no operation. > > It is completely stripped out by the compiler. Removing it since it doesn't > > do > > anything. > > > >

Re: [PATCH] target-core: don't use "const char*" for a buffer that is written to

2018-01-12 Thread Nicholas A. Bellinger
Hi Rasmus, Apologies for the delayed follow-up on this. On Tue, 2017-11-21 at 01:12 +0100, Rasmus Villemoes wrote: > From: Rasmus Villemoes > > iscsi_parse_pr_out_transport_id launders the const away via a call to > strstr(), and then modifies the buffer (writing a

Re: [PATCH] target: don't call an unmap callback if a range length is zero

2018-01-12 Thread Nicholas A. Bellinger
Hi Andrei, Apologies for the delayed follow up. On Wed, 2017-12-13 at 13:55 -0800, Andrei Vagin wrote: > If a length of a range is zero, it means there is nothing to unmap > and we can skip this range. > > Here is one more reason, why we have to skip such ranges. An unmap > callback calls

[GIT PULL] target updates for v4.15-rc1

2017-11-23 Thread Nicholas A. Bellinger
ode in iscsi_decode_text_input() Mike Christie (2): target: return SAM_STAT_TASK_SET_FULL for TCM_OUT_OF_RESOURCES tcmu: fix double se_cmd completion Nicholas Bellinger (6): target: Fix QUEUE_FULL + SCSI task attribute handling target: Fix caw_sem leak in transport_generic_request_failure target: Fix quiese dur

Re: [PATCH 1/2] tcmu: Fix some memory corruption

2017-11-08 Thread Nicholas A. Bellinger
On Wed, 2017-11-08 at 11:43 +0300, Dan Carpenter wrote: > "udev->nl_reply_supported" is an int but on 64 bit arches we are writing > 8 bytes of data to it so it corrupts four bytes beyond the end of the > struct. > > Fixes: b849b4567549 ("target: Add netlink command reply supported option for >

Re: [PATCH 2/2] tcmu: Add a missing unlock on an error path

2017-11-08 Thread Nicholas A. Bellinger
On Wed, 2017-11-08 at 11:44 +0300, Dan Carpenter wrote: > We added a new error path here but we forgot to drop the lock first > before returning. > > Fixes: 0d44374c1aae ("tcmu: fix double se_cmd completion") > Signed-off-by: Dan Carpenter Applied to

Re: target-pending/for-next patches

2017-11-08 Thread Nicholas A. Bellinger
On Sun, 2017-11-05 at 08:05 -0800, James Bottomley wrote: > On Sat, 2017-11-04 at 18:14 -0700, Nicholas A. Bellinger wrote: > > Hi all, > > > > Just a friendly email after catching up on patches this week, the > > majority of those outstanding on the list have been mer

[PATCH 1/6] target: Fix QUEUE_FULL + SCSI task attribute handling

2017-11-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> This patch fixes a bug during QUEUE_FULL where transport_complete_qf() calls transport_complete_task_attr() after it's already been invoked by target_complete_ok_work() or transport_generic_request_failure() during initial completion, prec

[PATCH 0/6] target fixes for v4.15-rc1

2017-11-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> Hi all, Here are the outstanding target bugfixes in queue for v4.15-rc1 code. Patch #1 addresses a long standing bug wrt to QUEUE_FULL and SCSI task attribute handling, that results in SCSI task related counters getting updated multiple

[PATCH 4/6] target: Avoid early CMD_T_PRE_EXECUTE failures during ABORT_TASK

2017-11-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> This patch fixes bug where early se_cmd exceptions that occur before backend execution can result in use-after-free if/when a subsequent ABORT_TASK occurs for the same tag. Since an early se_cmd exception will have had se_cmd added to se_s

[PATCH 3/6] target: Fix quiese during transport_write_pending_qf endless loop

2017-11-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> This patch fixes a potential end-less loop during QUEUE_FULL, where cmd->se_tfo->write_pending() callback fails repeatedly but __transport_wait_for_tasks() has already been invoked to quiese the outstanding se_cmd descriptor. To addr

[PATCH 2/6] target: Fix caw_sem leak in transport_generic_request_failure

2017-11-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> With the recent addition of transport_check_aborted_status() within transport_generic_request_failure() to avoid sending a SCSI status exception after CMD_T_ABORTED w/ TAS=1 has occured, it introduced a COMPARE_AND_WRITE early failure regr

[PATCH 5/6] iscsi-target: Make TASK_REASSIGN use proper se_cmd->cmd_kref

2017-11-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> Since commit 59b6986dbf fixed a potential NULL pointer dereference by allocating a se_tmr_req for ISCSI_TM_FUNC_TASK_REASSIGN, the se_tmr_req is currently leaked by iscsit_free_cmd() because no iscsi_cmd->se_cmd.se_tfo was associated. T

[PATCH 6/6] iscsi-target: Fix non-immediate TMR reference leak

2017-11-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> This patch fixes a se_cmd->cmd_kref reference leak that can occur when a non immediate TMR is proceeded our of command sequence number order, and CMDSN_LOWER_THAN_EXP is returned by iscsit_sequence_cmd(). To address this

target-pending/for-next patches

2017-11-04 Thread Nicholas A. Bellinger
Hi all, Just a friendly email after catching up on patches this week, the majority of those outstanding on the list have been merged into target-pending/for-next. Please see below. For those who submitted patches, please have a look and let me know if anything is else missing. Note there are

[GIT PULL] target fixes for v4.13-rc5

2017-08-12 Thread Nicholas A. Bellinger
regression (Justin Maggard + nab) Thank you, --nab Bryant G. Ly (1): tcmu: free old string on reconfig Nicholas Bellinger (3): qla2xxx: Fix incorrect tcm_qla2xxx_free_cmd use during TMR ABORT (v2) iscsi-target: Fix iscsi_np reset hung task during parallel delete target: Fix node_acl

Re: [PATCH] tcmu: Oops in unmap_thread_fn()

2017-08-06 Thread Nicholas A. Bellinger
On Tue, 2017-08-01 at 23:09 +0300, Dan Carpenter wrote: > Calling list_del() on the iterator pointer in list_for_each_entry() will > cause an oops. We need to user the _safe() version for that. > > Fixes: c73d02f63c16 ("tcmu: Add fifo type waiter list support to avoid > starvation") >

[PATCH] iscsi-target: Fix iscsi_np reset hung task during parallel delete

2017-08-06 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> This patch fixes a bug associated with iscsit_reset_np_thread() that can occur during parallel configfs rmdir of a single iscsi_np used across multiple iscsi-target instances, that would result in hung task(s) similar to below where configfs

[PATCH] qla2xxx: Fix incorrect tcm_qla2xxx_free_cmd use during TMR ABORT (v2)

2017-07-30 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> This patch drops two incorrect usages of tcm_qla2xxx_free_cmd() during TMR ABORT within tcm_qla2xxx_handle_data_work() and tcm_qla2xxx_aborted_task(), which where attempting to dispatch into workqueue context to do tcm_qla2xxx_complet

Re: [PATCH] tcmu: clean up the scatter helper

2017-07-30 Thread Nicholas A. Bellinger
On Thu, 2017-07-13 at 14:33 +0800, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > Add some comments to make the scatter code to be more readable. > > Signed-off-by: Xiubo Li > --- > drivers/target/target_core_user.c | 30

Re: [PATCH] tcmu: Fix possible to/from address overflow when doing the memcpy

2017-07-30 Thread Nicholas A. Bellinger
On Wed, 2017-07-12 at 15:51 +0800, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > For most case the sg->length equals to PAGE_SIZE, so this bug won't > be triggered. Otherwise this will crash the kernel, for example when > all segments' sg->length equal to

Re: [PATCHv2] tcmu: Add fifo type waiter list support to avoid starvation

2017-07-30 Thread Nicholas A. Bellinger
Hi Xiubo, Apologies for the delayed response. Comments below. On Wed, 2017-07-12 at 15:16 +0800, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > The fifo type waiter list will hold the udevs who are waiting for the > blocks from the data global pool. The

[GIT PULL] target updates for v4.13-rc1

2017-07-13 Thread Nicholas A. Bellinger
et: remove transport_complete target: fix SAM_STAT_BUSY/TASK_SET_FULL handling target: export lio pgr/alua support as device attr Nicholas Bellinger (12): target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout target/configfs: Kill se_device->dev_link_magic target/configfs: Kill se_lun->lun_li

Re: [PATCH] iscsi-target: Reject immediate data underflow larger than SCSI transfer length

2017-07-13 Thread Nicholas A. Bellinger
On Tue, 2017-07-11 at 16:17 +, Bart Van Assche wrote: > On Tue, 2017-07-11 at 00:22 -0700, Nicholas A. Bellinger wrote: > > So rejecting this case as already done in commit abb85a9b51 is the > > correct approach for >= v4.3.y. > > Hello Nic, > > I hope t

Re: [PATCH v2 01/15] qla2xxx: Combine Active command arrays.

2017-07-11 Thread Nicholas A. Bellinger
On Tue, 2017-07-11 at 23:43 +, Bart Van Assche wrote: > On Tue, 2017-06-13 at 20:47 -0700, Himanshu Madhani wrote: > > typedef struct srb { > > + /* > > +* Do not move cmd_type field, it needs to > > +* line up with qla_tgt_cmd->cmd_type > > +*/ > > + uint8_t cmd_type; > > +

Re: [PATCH] iscsi-target: Add login_keys_workaround attribute for non RFC initiators

2017-07-11 Thread Nicholas A. Bellinger
On Tue, 2017-07-11 at 23:38 +, Bart Van Assche wrote: > On Fri, 2017-07-07 at 22:24 +0000, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger <n...@linux-iscsi.org> > > > > This patch re-introduces part of a long standing login workaround th

Re: [PATCH] tcmu: clean up the code and with one small fix

2017-07-11 Thread Nicholas A. Bellinger
On Tue, 2017-07-11 at 18:06 +0800, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > Remove useless blank line and code and at the same time add one error > path to catch the errors. > > Signed-off-by: Xiubo Li > --- >

Re: [PATCHv2] tcmu: Fix possbile memory leak when recalculating the cmd base size

2017-07-11 Thread Nicholas A. Bellinger
On Tue, 2017-07-11 at 17:59 +0800, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > For all the entries allocated from the ring cmd area, the memory is > something like the stack memory, which will always reserve the old > data, so the

Re: [PATCH] tcmu: Fix possbile memory leak when recalculating the cmd base size

2017-07-11 Thread Nicholas A. Bellinger
On Tue, 2017-07-11 at 09:24 +, Damien Le Moal wrote: > Xiubo, > > Well done ! This fixed my problem. The ZBC test suite now passes all tests on > my target without crashing the kernel. > > Please see some comments/nitpicks below. > > Otherwise, please feel free to add my "tested-by" >

Re: [PATCH] iscsi-target: Add login_keys_workaround attribute for non RFC initiators

2017-07-11 Thread Nicholas A. Bellinger
A. Bellinger wrote: > From: Nicholas Bellinger <n...@linux-iscsi.org> > > This patch re-introduces part of a long standing login workaround that > was recently dropped by: > > commit 1c99de981f30b3e7868b8d20ce5479fa1c0fea46 > Author: Nicholas Bellinger <n...@linux-is

Re: [PATCH] scsi: qla2xxx: Off by one in qlt_ctio_to_cmd()

2017-07-11 Thread Nicholas A. Bellinger
g(ql_dbg_tgt, vha, 0xe052, > "qla_target(%d): Wrong handle %x received\n", > vha->vp_idx, handle); Nice catch. Reviewed-by: Nicholas Bellinger <n...@linux-iscsi.org>

Re: [PATCH] tcmu: Fix possible overflow for memcpy address in iovec

2017-07-11 Thread Nicholas A. Bellinger
Hey Xiubo, On Tue, 2017-07-11 at 16:04 +0800, Xiubo Li wrote: > Hi All > > Please ignore about this patch. > > Just my mistake. > > Sorry. > Damien (CC'ed) has been observing something similar atop the latest target-pending/for-next with his user-space ZBC backend:

Re: [PATCH] iscsi-target: Reject immediate data underflow larger than SCSI transfer length

2017-07-11 Thread Nicholas A. Bellinger
Hi Bart, On Thu, 2017-06-08 at 23:55 -0700, Nicholas A. Bellinger wrote: > On Thu, 2017-06-08 at 15:37 +, Bart Van Assche wrote: > > On Thu, 2017-06-08 at 04:21 +, Nicholas A. Bellinger wrote: > > > + /* > > > + * Check for underflow case where both EDTL

Re: [PATCH v2 00/15] qla2xxx: Add Target Multiqueue support

2017-07-07 Thread Nicholas A. Bellinger
/qla2xxx/qla_os.c | 156 -- > drivers/scsi/qla2xxx/qla_target.c | 1028 > +--- > drivers/scsi/qla2xxx/qla_target.h | 50 +- > drivers/scsi/qla2xxx/qla_version.h |4 +- > drivers/scsi/qla2xxx/tcm_qla2xxx.c |8 +- > 16 files changed, 13

[PATCH] iscsi-target: Add login_keys_workaround attribute for non RFC initiators

2017-07-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> This patch re-introduces part of a long standing login workaround that was recently dropped by: commit 1c99de981f30b3e7868b8d20ce5479fa1c0fea46 Author: Nicholas Bellinger <n...@linux-iscsi.org> Date: Sun Apr 2 13:36:4

Re: [PATCH 4/5] target: user: Fix sense data handling

2017-07-07 Thread Nicholas A. Bellinger
On Thu, 2017-07-06 at 23:05 -0700, Nicholas A. Bellinger wrote: > On Fri, 2017-07-07 at 14:14 +0900, Damien Le Moal wrote: > > Nicholas, > > > > On 7/7/17 13:50, Nicholas A. Bellinger wrote: > > > Hey MNC & Co, > > > > > > On Wed, 2017-06-28

Re: [PATCH 4/5] target: user: Fix sense data handling

2017-07-07 Thread Nicholas A. Bellinger
On Fri, 2017-07-07 at 14:14 +0900, Damien Le Moal wrote: > Nicholas, > > On 7/7/17 13:50, Nicholas A. Bellinger wrote: > > Hey MNC & Co, > > > > On Wed, 2017-06-28 at 12:44 -0500, Mike Christie wrote: > >> On 06/28/2017 12:58 AM, Damien Le Moal wrote: >

Re: [PATCH 5/5] target: core: Fix failed command sense data handling

2017-07-06 Thread Nicholas A. Bellinger
(Adding MNC CC') On Wed, 2017-06-28 at 14:59 +0900, Damien Le Moal wrote: > For a target device without a transport->transport_complete method > defined (e.g. target_core_user), target_complete_cmd() will always > result in a failed command completion being processed through target > failure

Re: [PATCH 4/5] target: user: Fix sense data handling

2017-07-06 Thread Nicholas A. Bellinger
(Adding MNC CC') On Wed, 2017-06-28 at 14:58 +0900, Damien Le Moal wrote: > If the user request handler completed the request with a CHECK CONDITION > status, tcmu_handle_completion() copies the command entry sense data > into the session request structure sense data. However, the sense data >

Re: [PATCH 3/5] target: pscsi: Fix sense data handling

2017-07-06 Thread Nicholas A. Bellinger
(Adding MNC CC') On Wed, 2017-06-28 at 14:58 +0900, Damien Le Moal wrote: > On completion of a request sent to the target backstore device, > pscsi_req_done() calls target_complete_cmd() which in turn will execute > pscsi_transport_complete(). In case of a failed request, this last > function

Re: [PATCH 2/5] target: pscsi: Introduce TYPE_ZBC support

2017-07-06 Thread Nicholas A. Bellinger
On Wed, 2017-06-28 at 14:58 +0900, Damien Le Moal wrote: > TYPE_ZBC host managed zoned block devices are also block devices > despite the non-standard device type (14h). Handle them similarly to > regular TYPE_DISK devices. > > Signed-off-by: Damien Le Moal > --- >

Re: [PATCH 1/5] target: Use macro for WRITE_VERIFY_xx operation codes

2017-07-06 Thread Nicholas A. Bellinger
Hi Damien, On Wed, 2017-06-28 at 14:58 +0900, Damien Le Moal wrote: > Add WRITE_VERIFY_32 definition to scsi prototypes and use this macro > definition isntead of the hard coded value. Same for the already defined > WRITE_VERIFY_16 command code. > > Signed-off-by: Damien Le Moal

Re: [PATCH 4/5] target: user: Fix sense data handling

2017-07-06 Thread Nicholas A. Bellinger
Hey MNC & Co, On Wed, 2017-06-28 at 12:44 -0500, Mike Christie wrote: > On 06/28/2017 12:58 AM, Damien Le Moal wrote: > > If the user request handler completed the request with a CHECK CONDITION > > status, tcmu_handle_completion() copies the command entry sense data > > into the session request

Re: [PATCH] target: make device_mutex and device_list static

2017-07-06 Thread Nicholas A. Bellinger
On Wed, 2017-07-05 at 13:15 -0500, Mike Christie wrote: > On 07/04/2017 03:44 AM, Colin King wrote: > > From: Colin Ian King > > > > Variables device_mutex and device_list static are local to the source, > > so make them static. > > > > Cleans up sparse warnings: > >

Re: [PATCH] tcmu: Fix flushing cmd entry dcache page

2017-07-02 Thread Nicholas A. Bellinger
On Fri, 2017-06-30 at 16:14 +0800, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > When feeding the tcmu's cmd ring, we need to flush the dcache page > for the cmd entry to make sure these kernel stores are visible to > user space mappings of that page. >

Re: [PATCH v4 0/5] tcmu: Add Type of reconfig into netlink

2017-06-30 Thread Nicholas A. Bellinger
Hey MNC, On Mon, 2017-06-12 at 01:43 -0500, Mike Christie wrote: > On 06/11/2017 04:02 PM, Mike Christie wrote: > > On 06/09/2017 01:11 AM, Nicholas A. Bellinger wrote: > >> Hi Bryant & Co, > >> > >> On Tue, 2017-06-06 at 09:28 -0500, Bryant G.

Re: [PATCH][V2][target-devel-next] tcmu: make array tcmu_attrib_attrs static const

2017-06-25 Thread Nicholas A. Bellinger
On Tue, 2017-06-13 at 14:29 +0100, Colin King wrote: > From: Colin Ian King > > The array tcmu_attrib_attrs does not need to be in global scope, so make > it static. > > Cleans up sparse warning: > "symbol 'tcmu_attrib_attrs' was not declared. Should it be static?" >

Re: [PATCH] tcmu: Fix module removal due to stuck unmap_thread thread again

2017-06-25 Thread Nicholas A. Bellinger
On Thu, 2017-06-15 at 15:05 +0800, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > Because the unmap code just after the schdule() returned may take > a long time and if the kthread_stop() is fired just when in this > routine, the module removal maybe stuck

[GIT PULL] target fixes for v4.12-rc7

2017-06-24 Thread Nicholas A. Bellinger
refcount_t conversion in upstream. - Fix a iscsi-target corner case during explicit connection logout timeout failure. - Address last fallout in iscsi-target immediate data handling from v4.4 target-core now allowing control CDB payload underflow. Thank you, --nab Nicholas Bellinger (3

Re: [PATCH] configfs: Fix race between create_link and configfs_rmdir

2017-06-09 Thread Nicholas A. Bellinger
On Thu, 2017-06-08 at 07:34 -0500, Bryant G. Ly wrote: > > Thanks Nic, > > > > applied to the configfs-for-next tree. I'm not entirely sure if we > > should bother adding this to 4.12 or if it hits rarely enough? > > > It hits for us pretty often when we have a GPFS setup with 10 hosts and 1k+ >

Re: [PATCH] iscsi-target: Reject immediate data underflow larger than SCSI transfer length

2017-06-09 Thread Nicholas A. Bellinger
On Thu, 2017-06-08 at 15:37 +, Bart Van Assche wrote: > On Thu, 2017-06-08 at 04:21 +0000, Nicholas A. Bellinger wrote: > > + /* > > +* Check for underflow case where both EDTL and immediate data payload > > +* exceeds what is presented by CDB's TRANSFER

Re: [PATCH 00/15] qla2xxx: Add Target Multiqueue support

2017-06-09 Thread Nicholas A. Bellinger
Hi Himanshu & Quinn, On Wed, 2017-06-07 at 14:43 -0700, Himanshu Madhani wrote: > Hi Nic, > > This patch series adds support for multiqueue for qla2xxx target mode driver. > > I've also added patch ("qla2xxx: Include Exchange offload/Extended Login > into FW dump") which was dropped from

Re: [PATCH v4 0/5] tcmu: Add Type of reconfig into netlink

2017-06-09 Thread Nicholas A. Bellinger
Hi Bryant & Co, On Tue, 2017-06-06 at 09:28 -0500, Bryant G. Ly wrote: > From: "Bryant G. Ly" > > This patch consists of adding a netlink to allow for reconfiguration > of a device in tcmu. > > It also changes and adds some attributes that are reconfigurable: > write_cache,

Re: [PATCH v1] ibmvscsis: Use tpgt passed in by user

2017-06-08 Thread Nicholas A. Bellinger
On Tue, 2017-06-06 at 15:45 -0500, Bryant G. Ly wrote: > ibmvscsis always returned 0 for the tpg/tag, since it did not > parse the value passed in by the user. > > When functions like ALUA members exports the value, it will > be incorrect because targetcli/rtslib starts the tpg numbering > at 1.

Re: [PATCH 2/3] target: Add TARGET_SCF_LOOKUP_LUN_FROM_TAG support for ABORT_TASK

2017-06-08 Thread Nicholas A. Bellinger
On Mon, 2017-06-05 at 15:57 +, Bart Van Assche wrote: > On Sat, 2017-06-03 at 22:10 +0000, Nicholas A. Bellinger wrote: > > +static bool target_lookup_lun_from_tag(struct se_session *se_sess, u64 tag, > > + u64 *unpacked_lun) > > +{

Re: [PATCH 0/3] target: Add TARGET_SCF_LOOKUP_LUN_FROM_TAG support

2017-06-08 Thread Nicholas A. Bellinger
Hi Himanshu & Quinn, On Wed, 2017-06-07 at 05:02 +, Madhani, Himanshu wrote: > > On Jun 3, 2017, at 3:10 PM, Nicholas A. Bellinger <n...@linux-iscsi.org> > > wrote: > > > > From: Nicholas Bellinger <n...@linux-iscsi.org> > > > >

Re: [PATCH] iscsi-target: Fix delayed logout processing greater than SECONDS_FOR_LOGOUT_COMP

2017-06-08 Thread Nicholas A. Bellinger
Reviews pretty please..? On Sat, 2017-06-03 at 21:32 +, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger <n...@linux-iscsi.org> > > This patch fixes a BUG() in iscsit_close_session() that could be > triggered when iscsit_logout_post_handler() execution from within &

Re: [PATCH] target: Fix kref->refcount underflow in transport_cmd_finish_abort

2017-06-08 Thread Nicholas A. Bellinger
(Adding Quinn CC') Reviews please..? On Sat, 2017-06-03 at 21:09 +, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger <n...@linux-iscsi.org> > > This patch fixes a se_cmd->cmd_kref underflow during CMD_T_ABORTED > when a fabric driver drops it's second

[PATCH] configfs: Fix race between create_link and configfs_rmdir

2017-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> This patch closes a long standing race in configfs between the creation of a new symlink in create_link(), while the symlink target's config_item is being concurrently removed via configfs_rmdir(). This can happen because the symlink ta

[PATCH] iscsi-target: Reject immediate data underflow larger than SCSI transfer length

2017-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> When iscsi WRITE underflow occurs there are two different scenarios that can happen. Normally in practice, when an EDTL vs. SCSI CDB TRANSFER LENGTH underflow is detected, the iscsi immediate data payload is the smaller SCSI CDB TRANSFER

[PATCH 1/3] target: Add support for TMR percpu reference counting

2017-06-03 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> This patch introduces TMR percpu reference counting using se_lun->lun_ref in transport_lookup_tmr_lun(), following how existing non TMR per se_lun reference counting works within transport_lookup_cmd_lun(). It also adds

[PATCH 3/3] qla2xxx: Convert QLA_TGT_ABTS to TARGET_SCF_LOOKUP_LUN_FROM_TAG

2017-06-03 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> Following Himanshu's earlier patch to drop the redundant tag lookup within __qlt_24xx_handle_abts(), go ahead and drop this now QLA_TGT_ABTS can use TARGET_SCF_LOOKUP_LUN_FROM_TAG and have target_submit_tmr() do this from common code. Cc: Hi

[PATCH 0/3] target: Add TARGET_SCF_LOOKUP_LUN_FROM_TAG support

2017-06-03 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> Hi Himanshu + Quinn, Here is a small series to introduce proper percpu se_lun->lun_ref counting for TMR, and add common code in target_submit_tmr() to do tag lookup for unpacked_lun in order to drop the original driver specific look

[PATCH 2/3] target: Add TARGET_SCF_LOOKUP_LUN_FROM_TAG support for ABORT_TASK

2017-06-03 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> This patch introduces support in target_submit_tmr() for locating a unpacked_lun from an existing se_cmd->tag during ABORT_TASK. When TARGET_SCF_LOOKUP_LUN_FROM_TAG is set, target_submit_tmr() will do the extra lookup via target_lookup_lun

[PATCH] iscsi-target: Fix delayed logout processing greater than SECONDS_FOR_LOGOUT_COMP

2017-06-03 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> This patch fixes a BUG() in iscsit_close_session() that could be triggered when iscsit_logout_post_handler() execution from within tx thread context was not run for more than SECONDS_FOR_LOGOUT_COMP (15 seconds), and the TCP connection

[PATCH] target: Fix kref->refcount underflow in transport_cmd_finish_abort

2017-06-03 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> This patch fixes a se_cmd->cmd_kref underflow during CMD_T_ABORTED when a fabric driver drops it's second reference from below the target_core_tmr.c based callers of transport_cmd_finish_abort(). Recently with the conversion of kref to r

Re: [PATCH v2 0/5] TCMU Enable Reconfiguration Patches

2017-06-03 Thread Nicholas A. Bellinger
Hi Bryant & Co, On Tue, 2017-05-30 at 13:31 -0500, Bryant G. Ly wrote: > This patch consists of adding a netlink to allow for reconfiguration > of a device in tcmu. > > It also changes and adds some attributes that are reconfigurable: > write_cache, device size, and device path. > > Bryant G.

Re: [PATCH] iscsi: Fix a sleep-in-atomic bug

2017-06-01 Thread Nicholas A. Bellinger
On Fri, 2017-06-02 at 09:13 +0800, Jia-Ju Bai wrote: > On 06/01/2017 02:21 PM, Nicholas A. Bellinger wrote: > > Hi Jia-Ju, > > > > On Wed, 2017-05-31 at 11:26 +0800, Jia-Ju Bai wrote: > >> The driver may sleep under a spin lock, and the function call path is: >

[PATCH-v2] target: Avoid target_shutdown_sessions loop during queue_depth change

2017-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> When target_shutdown_sessions() is invoked to shutdown all active sessions associated with a se_node_acl when se_node_acl->queue_depth is changed via core_tpg_set_initiator_node_queue_depth(), it's possible that new connections reconnect im

[PATCH 1/2] target/configfs: Kill se_device->dev_link_magic

2017-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> Instead of using a hardcoded magic value in se_device when verifying a target config_item symlink source during target_fabric_port_link(), go ahead and use target_core_dev_item_ops directly instead. Cc: Christoph Hellwig <h...@lst.de&

[PATCH 2/2] target/configfs: Kill se_lun->lun_link_magic

2017-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> Instead of using a hardcoded magic value in se_lun when verifying a target config_item symlink source during target_fabric_mappedlun_link(), go ahead and use target_fabric_port_item_ops directly instead. Cc: Christoph Hellwig <h...@lst.de&

Re: [PATCH] target: Avoid target_shutdown_sessions loop during queue_depth change

2017-06-01 Thread Nicholas A. Bellinger
On Thu, 2017-06-01 at 08:57 +0200, Christoph Hellwig wrote: > How about this slightly easier to read version? Fine by me. Applied.

[PATCH-v2] target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout

2017-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> The people who are actively using iblock_execute_write_same_direct() are doing so in the context of ESX VAAI BlockZero, together with EXTENDED_COPY and COMPARE_AND_WRITE primitives. In practice though I've not seen any users of IBLOCK WRIT

[PATCH] target: Avoid target_shutdown_sessions loop during queue_depth change

2017-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> When target_shutdown_sessions() is invoked to shutdown all active sessions associated with a se_node_acl when se_node_acl->queue_depth is changed via core_tpg_set_initiator_node_queue_depth(), it's possible that new connections reconnect im

Re: [PATCH 2/8] target: remove iblock WRITE_SAME passthrough support

2017-06-01 Thread Nicholas A. Bellinger
n true; } EXPORT_SYMBOL(target_configure_unmap_from_queue); Any objections..? On Tue, 2017-04-11 at 22:30 -0700, Nicholas A. Bellinger wrote: > On Mon, 2017-04-10 at 18:08 +0200, Christoph Hellwig wrote: > > Use the pscsi driver to support arbitrary command passthrough > > instea

Re: [PATCH] iscsi: Fix a sleep-in-atomic bug

2017-06-01 Thread Nicholas A. Bellinger
Hi Jia-Ju, On Wed, 2017-05-31 at 11:26 +0800, Jia-Ju Bai wrote: > The driver may sleep under a spin lock, and the function call path is: > iscsit_tpg_enable_portal_group (acquire the lock by spin_lock) > iscsi_update_param_value > kstrdup(GFP_KERNEL) --> may sleep > > To fix it, the

Re: [PATCH] tcmu: Add fifo type waiter list support to avoid starvation

2017-06-01 Thread Nicholas A. Bellinger
Hey MNC, Any comments on this..? It's been sitting on the list for a while now.. ;) On Fri, 2017-05-05 at 10:51 +0800, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > The fifo type waiter list will hold the udevs who are waiting for the > blocks from

[GIT PULL] target fixes for v4.12-rc4

2017-05-31 Thread Nicholas A. Bellinger
. Ly (2): ibmvscsis: Clear left-over abort_cmd pointers ibmvscsis: Fix the incorrect req_lim_delta Jiang Yi (1): iscsi-target: Always wait for kthread_should_stop() before kthread exit Mike Christie (1): tcmu: fix crash during device removal Nicholas Bellinger (2): target: Re-add

Re: [PATCH] iscsi-target: Fix initial login PDU asynchronous socket close OOPs

2017-05-31 Thread Nicholas A. Bellinger
On Wed, 2017-05-31 at 15:28 -0500, Mike Christie wrote: > On 05/30/2017 11:58 PM, Nicholas A. Bellinger wrote: > > Hey MNC, > > > > On Fri, 2017-05-26 at 22:14 -0500, Mike Christie wrote: > >> Thanks for the patch. > >> The patch fixes the cra

Re: [PATCH] iscsi-target: Fix initial login PDU asynchronous socket close OOPs

2017-05-30 Thread Nicholas A. Bellinger
12:32 AM, Nicholas A. Bellinger wrote: > > > > - state = iscsi_target_sk_state_check(sk); > > - write_unlock_bh(>sk_callback_lock); > > - > > - pr_debug("iscsi_target_sk_state_change: state: %d\n", state); > > + orig_state_change

[PATCH] iscsi-target: Fix initial login PDU asynchronous socket close OOPs

2017-05-25 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> This patch fixes a OOPs originally introduced by: commit bb048357dad6d604520c91586334c9c230366a14 Author: Nicholas Bellinger <n...@linux-iscsi.org> Date: Thu Sep 5 14:54:04 2013 -0700 iscsi-target: Add sk->sk_state_ch

Re: [PATCH] ibmvscsis: Enable Logical Partition Migration Support

2017-05-23 Thread Nicholas A. Bellinger
On Tue, 2017-05-16 at 17:49 -0500, Bryant G. Ly wrote: > From: Michael Cyr > > Changes to support a new mechanism from phyp to better synchronize the > logical partition migration (LPM) of the client partition. > This includes a new VIOCTL to register that we support this new

Re: [PATCH] target: remove dead code

2017-05-23 Thread Nicholas A. Bellinger
On Thu, 2017-05-11 at 13:39 -0700, Tyrel Datwyler wrote: > On 05/09/2017 02:46 PM, Gustavo A. R. Silva wrote: > > Local variable _ret_ is assigned to a constant value and it is never > > updated again. Remove this variable and the dead code it guards. > > > > Addresses-Coverity-ID: 140761 > >

Re: [PATCH 13/25] tcm_qla2xxx: Do not allow aborted cmd to advance.

2017-05-21 Thread Nicholas A. Bellinger
o I'm still considering the different approaches to address this in target-core proper, but don't have a problem with merging this as-is as it won't logically conflict with any of those changes. That said: Acked-by: Nicholas Bellinger <n...@linux-iscsi.org>

Re: [PATCH 15/25] qla2xxx: Convert 32-bit LUN usage to 64-bit

2017-05-21 Thread Nicholas A. Bellinger
_24xx_handle_abts() Bart mentioned earlier, looks fine. Acked-by: Nicholas Bellinger <n...@linux-iscsi.org>

Re: [PATCH 20/25] qla2xxx: Remove redundant code

2017-05-21 Thread Nicholas A. Bellinger
walks from __qlt_24xx_handle_abts() are used to track descriptors only before __qlt_do_work() is reached, and before a descriptor is submitted into tcm_qla2xxx code. Or rather, the three lists in abort_cmd_for_tag() only contain qla_tgt_cmd or qla_tgt_sess_op descriptors that have not yet reached qla_tgt_func_tmpl->handle_cmd() code. Both qlt_do_work() and qlt_create_sess_from_atio() drop their respective descriptors from ->cmd_list before dispatching into tcm_qla2xxx -> target-core, which means there is no way for a descriptor to be part of internal lists once __qlt_do_work() is called. That said, the patch is correct and removes the redundant lookup. Acked-by: Nicholas Bellinger <n...@linux-iscsi.org>

[GIT PULL] target updates for v4.12-rc1

2017-05-11 Thread Nicholas A. Bellinger
ule removal due to stuck thread Nicholas Bellinger (4): target: Fix compare_and_write_callback handling for non GOOD status iscsi-target: Set session_fall_back_to_erl0 when forcing reinstatement target: Don't force session reset if queue_depth does not change Revert "target: Fi

[PATCH] target: Re-add check to reject control WRITEs with overflow data

2017-05-11 Thread Nicholas A. Bellinger
From: Nicholas Bellinger <n...@linux-iscsi.org> During v4.3 when the overflow/underflow check was relaxed by commit c72c525022: commit c72c5250224d475614a00c1d7e54a67f77cd3410 Author: Roland Dreier <rol...@purestorage.com> Date: Wed Jul 22 15:08:18 2015 -0700 t

Re: [PATCH v1] ibmvscsis: Fix cleaning up pointers

2017-05-11 Thread Nicholas A. Bellinger
On Thu, 2017-05-11 at 10:40 -0500, Bryant G. Ly wrote: > On 5/9/17 10:45 PM, Nicholas A. Bellinger wrote: > > > On Tue, 2017-05-09 at 11:50 -0500, Bryant G. Ly wrote: > >> This patch is dependent on: > >> 'commit 25e78531268e ("ibmvscsis: Do not send abort

Re: [PATCH v2] ibmvscsis: Fix the incorrect req_lim_delta

2017-05-11 Thread Nicholas A. Bellinger
On Wed, 2017-05-10 at 14:35 -0500, Bryant G. Ly wrote: > The current code is not correctly calculating the req_lim_delta. > > We want to make sure vscsi->credit is always incremented when > we do not send a response for the scsi op. Thus for the case where > there is a successfully aborted task

Re: [PATCH 25/27] block: remove the discard_zeroes_data flag

2017-05-11 Thread Nicholas A. Bellinger
On Thu, 2017-05-11 at 08:26 +0200, h...@lst.de wrote: > On Wed, May 10, 2017 at 09:50:35PM -0700, Nicholas A. Bellinger wrote: > > 1) Expose a block_device or request_queue bit to signal 'real LBPRZ' > > support up to IBLOCK, in order to maintain SCSI target feature > > compa

Re: [PATCH 25/27] block: remove the discard_zeroes_data flag

2017-05-10 Thread Nicholas A. Bellinger
On Wed, 2017-05-10 at 16:06 +0200, h...@lst.de wrote: > On Mon, May 08, 2017 at 11:46:14PM -0700, Nicholas A. Bellinger wrote: > > That said, simply propagating up q->limits.max_write_zeroes_sectors as > > dev_attrib->unmap_zeroes_data following existing code still looks lik

Re: [PATCH v1] ibmvscsis: Fix cleaning up pointers

2017-05-09 Thread Nicholas A. Bellinger
On Tue, 2017-05-09 at 11:50 -0500, Bryant G. Ly wrote: > This patch is dependent on: > 'commit 25e78531268e ("ibmvscsis: Do not send aborted task response")' > This patch cleans up some pointers after usage. > > Signed-off-by: Bryant G. Ly > Reviewed-by: Michael Cyr

Re: [PATCH 25/27] block: remove the discard_zeroes_data flag

2017-05-09 Thread Nicholas A. Bellinger
On Sun, 2017-05-07 at 11:22 +0200, h...@lst.de wrote: > On Tue, May 02, 2017 at 08:33:15PM -0700, Nicholas A. Bellinger wrote: > > The larger target/iblock conversion patch looks like post v4.12 material > > at this point, so to avoid breakage wrt to existing LBPRZ behavior, I'll &

Re: [PATCH v4] ibmvscsis: Do not send aborted task response

2017-05-08 Thread Nicholas A. Bellinger
Hi Bryant, Given running we're almost out of time for -rc1, I'd like to avoid having to rebase the handful of patches that are atop the -v3 that was applied to target-pending/for-next over the weekend... So if you'd be so kind, please post an incremental patch atop -v3, and I'll apply that

Re: [PATCH v3] ibmvscsis: Do not send aborted task response

2017-05-07 Thread Nicholas A. Bellinger
On Fri, 2017-05-05 at 14:17 -0500, Bryant G. Ly wrote: > The driver is sending a response to the actual scsi op that was > aborted by an abort task TM, while LIO is sending a response to > the abort task TM. > > ibmvscsis_tgt does not send the response to the client until > release_cmd time. The

  1   2   3   4   5   6   7   8   9   10   >