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 > >

Re: [PATCH 0/2] target: Fix v4.19-rc active I/O shutdown deadlock

2018-10-09 Thread Nicholas A. Bellinger
On Wed, 2018-10-10 at 03:23 +, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > Hi MNC, MKP & Co, > > While testing v4.19-rc recently with simple backend I/O error injection > (via delayed BIO completion), I was able to trigger an end-less loop > deadlo

[PATCH 1/2] sched/wait: Add wait_event_lock_irq_timeout for TASK_UNINTERRUPTIBLE usage

2018-10-09 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Short of reverting commit 00d909a107 for v4.19, target-core needs a wait_event_t marco can be executed using TASK_UNINTERRUPTIBLE to function correctly with existing fabric drivers that expect to run with signals pending during session shutdown and active se_cmd I/O quies

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

2018-10-09 Thread Nicholas A. Bellinger
From: Nicholas Bellinger With the addition of commit 00d909a107 in v4.19-rc, it incorrectly assumes no signals will be pending for task_struct executing the normal session shutdown and I/O quiesce code-path. For example, iscsi-target and iser-target issue SIGINT to all kthreads as part of sessio

[PATCH 0/2] target: Fix v4.19-rc active I/O shutdown deadlock

2018-10-09 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Hi MNC, MKP & Co, While testing v4.19-rc recently with simple backend I/O error injection (via delayed BIO completion), I was able to trigger an end-less loop deadlock with recent changes in commit 00d909a107: Author: Bart Van Assche Date: Fri Jun 22 14:52:53 201

[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) - Prev

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 > > > index b686e2ce9c0e.

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. > > > > Sig

Re: A qla2xxx commit cause Linux no response, has not fixed in lastest version 4.15-rc6

2018-01-12 Thread Nicholas A. Bellinger
Hi Chang & Co, (Adding list + Himanshu CC') On Sun, 2018-01-07 at 10:21 +, Changlimin wrote: > Hi, > It seems the qla2xxx commit cause Linux no response, has not fixed in lastest > version 4.15-rc6. > https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=726b8548

Re: [PATCH -next] tcmu: fix error return code in tcmu_configure_device()

2018-01-12 Thread Nicholas A. Bellinger
On Thu, 2018-01-11 at 11:10 -0600, Mike Christie wrote: > On 01/11/2018 05:12 AM, Wei Yongjun wrote: > > Fix to return error code -ENOMEM from the kzalloc() error handling > > case instead of 0, as done elsewhere in this function. > > > > Fixes: fabe6a59cc5a ("tcmu: allow max block and global max

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 nul byte) through > the retur

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 file_

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

2017-11-23 Thread Nicholas A. Bellinger
Hello Linus, Here are the target-pending updates for v4.15-rc1. Please go ahead and pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git for-next This series is predominantly bug-fixes, with a few small improvements that have been outstanding over the last release c

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 > e

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 target-pending/for-next. Thanks DanC !

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 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, preceeding QUEUE_FULL. This will res

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

2017-11-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 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 times during QUEUE_FULL. It prim

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

2017-11-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 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_session->sess_cmd_list via target

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

2017-11-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 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 address this bug, this patch adds a CMD_T_

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

2017-11-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 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 regression. Namely when COMPARE_AND_

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

2017-11-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 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. To address this, treat ISCSI_TM_FUNC

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

2017-11-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 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 bug, call target_put_sess_cmd() during this specia

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 tw

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

2017-08-12 Thread Nicholas A. Bellinger
Hi Linus, Here are the target-pending fixes for v4.13-rc5. Please go ahead and pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master The highlights include: - Fix iscsi-target payload memory leak during ISCSI_FLAG_TEXT_CONTINUE (Varun Prakash) - Fix tcm_qla

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") > Signed-off

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

2017-08-06 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 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 rmdir process context was bloc

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

2017-07-30 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 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_complete_free() and subsequently invoke trans

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 +- > 1 file changed, 25 insertions

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 1K. > > Signed-off-by: Xiubo

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 unmap thread will try to feed

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

2017-07-13 Thread Nicholas A. Bellinger
Hi Linus, Here are the target-pending updates for v4.13-rc1. Please go ahead and pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git for-next Note there is a qla2xxx conflict with scsi.git as reported by SFR, which should be straight-forward to resolve: https://lk

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 > > > > This patch re-introduces part of a long standing login workaround that > > was recently dr

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 > --- > drivers/target/target_core_user.c | 24 +++- > 1

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 entry->req.iov_bidi_cnt maybe none zero. > > On some

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" > Grea

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

2017-07-11 Thread Nicholas A. Bellinger
Hey Robert, Any chance to test this with your Flexboot PXE setup..? Please give this a spin ASAP to verify it addresses the regression you reported earlier, wrt FirstBurstLength not being proposed nor responded to using Flexboot PXE. Thank you. On Fri, 2017-07-07 at 22:24 +, Nicholas A

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

2017-07-11 Thread Nicholas A. Bellinger
On Mon, 2017-07-10 at 11:47 +0300, Dan Carpenter wrote: > There are "req->num_outstanding_cmds" elements in the > req->outstanding_cmds[] array so the > here should be >=. > > Signed-off-by: Dan Carpenter > > diff --git a/drivers/scsi/qla2xxx/qla_target.c > b/drivers/scsi/qla2xxx/qla_target.c >

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: http://www.spinics.net/lis

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
Hey guys, Apologies for missing this earlier. Comments below. On Tue, 2017-06-13 at 20:47 -0700, Himanshu Madhani wrote: > Hi Martin, Nic, > > This patch series adds support for multiqueue for qla2xxx target mode driver. > > This series depends on the seris applied to Martin's scsi/for-next br

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

2017-07-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch re-introduces part of a long standing login workaround that was recently dropped by: commit 1c99de981f30b3e7868b8d20ce5479fa1c0fea46 Author: Nicholas Bellinger Date: Sun Apr 2 13:36:44 2017 -0700 iscsi-target: Drop work-around for legacy Global

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

2017-07-06 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-06 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 compl

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 > len

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 will

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 > --- > drivers/target/target_core_psc

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 > --- > drivers

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 s

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: > > "symbol 'device_list' was no

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. > > For the none PAD cmd entry, t

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, Bryan

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?" > > Signed-off-by: Colin Ian

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 too. > > Signed-off-by: Xiubo

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

2017-06-24 Thread Nicholas A. Bellinger
Hi Linus, Here are the target-pending fixes for v4.12-rc7 that have been queued up for the last 2 weeks. Please go ahead and pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master This includes: - Fix a TMR related kref underflow detected by the recent refcoun

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-08 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 TRA

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

2017-06-08 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 earlier

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

2017-06-08 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, device size, and dev

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 > > wrote: > > > > From: Nicholas Bellinger > > > > Hi Himanshu + Quinn, > > > > Here is a sma

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 > > 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 n

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 +0000, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > 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

[PATCH] configfs: Fix race between create_link and configfs_rmdir

2017-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 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 target's reference is obtained by con

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

2017-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 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 LENGTH. That is, when a host fab

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

2017-06-03 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 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 explicit transport_lun_remove_cmd() calls to drop t

[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 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: Himanshu Madhani Cc: Quinn Tran

[PATCH 0/3] target: Add TARGET_SCF_LOOKUP_LUN_FROM_TAG support

2017-06-03 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 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 lookup within __qlt_24xx_handle_abts(). It

[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 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_from_tag() and subsequently inv

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

2017-06-03 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 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 didn't already close before then for

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

2017-06-03 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 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 refcount_t, this bug was manifestin

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

2017-06-02 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. Ly

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 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 immediately after explicit shutdow

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

2017-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 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 Cc: Mike Christie Cc: Hannes Reinecke Signed-of

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

2017-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 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 Cc: Mike Christie Cc: Hannes Reinecke Sign

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 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 WRITE_SAME for anything other than V

[PATCH] target: Avoid target_shutdown_sessions loop during queue_depth change

2017-05-31 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 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 immediately after explicit shutdow

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

2017-05-31 Thread Nicholas A. Bellinger
return 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 > > i

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

2017-05-31 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 "GFP_KE

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

2017-05-31 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 the data global pool. The unmap t

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

2017-05-31 Thread Nicholas A. Bellinger
Hello Linus, Here are the target-pending fixes for v4.12-rc4. Please go ahead and pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master This includes: - ibmviscsis ABORT_TASK handling fixes that missed the v4.12 merge window. (Bryant Ly and Michael Cyr

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
05/26/2017 12:32 AM, Nicholas A. Bellinger wrote: > > > > - state = iscsi_target_sk_state_check(sk); > > - write_unlock_bh(&sk->sk_callback_lock); > > - > > - pr_debug("iscsi_target_sk_state_change: state: %d\n", state); > > + ori

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

2017-05-25 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch fixes a OOPs originally introduced by: commit bb048357dad6d604520c91586334c9c230366a14 Author: Nicholas Bellinger Date: Thu Sep 5 14:54:04 2013 -0700 iscsi-target: Add sk->sk_state_change to cleanup after TCP failure which would trigger a NULL

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 > functionality, and

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 > > Sign

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

2017-05-21 Thread Nicholas A. Bellinger
On Fri, 2017-05-19 at 14:53 -0700, Himanshu Madhani wrote: > From: Quinn Tran > > In case of hardware queue full, commands can loop between > TCM stack and tcm_qla2xx shim layers for retry. While command > is waiting for retry, task mgmt can get ahead and abort the > cmmand that encountered queue

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

2017-05-21 Thread Nicholas A. Bellinger
On Fri, 2017-05-19 at 14:53 -0700, Himanshu Madhani wrote: > From: Quinn Tran > > Convert 32bit LUN field to 64bit LUN. > > Signed-off-by: Quinn Tran > Signed-off-by: Himanshu Madhani > --- > drivers/scsi/qla2xxx/qla_target.c | 30 +- > drivers/scsi/qla2xxx/qla_ta

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

2017-05-21 Thread Nicholas A. Bellinger
On Fri, 2017-05-19 at 23:43 +, Bart Van Assche wrote: > On Fri, 2017-05-19 at 14:53 -0700, Himanshu Madhani wrote: > > From: Quinn Tran > > > > During ABTS or Abort task, qla2xxx does a pre-search for > > the se_cmd, based on command's tag. The same search is > > performed by TCM. Remove the

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

2017-05-11 Thread Nicholas A. Bellinger
Hi Linus, Here are the target-pending updates for v4.12-rc1. Please go ahead and pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git for-next Things where alot more calm than previously expected. It's primarily fixes in various areas, with most of the new function

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

2017-05-11 Thread Nicholas A. Bellinger
From: Nicholas Bellinger During v4.3 when the overflow/underflow check was relaxed by commit c72c525022: commit c72c5250224d475614a00c1d7e54a67f77cd3410 Author: Roland Dreier Date: Wed Jul 22 15:08:18 2015 -0700 target: allow underflow/overflow for PR OUT etc. commands to allow

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

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

2017-05-10 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 we

  1   2   3   4   5   6   7   8   9   10   >