Re: [PATCH v2] target/file: add support of direct and async I/O

2018-05-08 Thread Mike Christie
> > No problem queuing it up if I get an ACK from Christoph or Mike. > I think Christoph Ackd it here https://www.spinics.net/lists/target-devel/msg16575.html It also seems ok to me. Reviewed-by: Mike Christie <mchri...@redhat.com>

Re: [PATCHv4 1/3] target/configfs: add module wide action support

2018-05-03 Thread Mike Christie
On 05/02/2018 08:03 PM, Xiubo Li wrote: > On 2018/5/3 2:27, Mike Christie wrote: >> On 04/19/2018 02:46 AM, xiu...@redhat.com wrote: >>> From: Xiubo Li <xiu...@redhat.com> >>> >>> For some case we need some module wide configfs to contol some >>>

Re: [PATCHv4 3/3] tcmu: add module wide action/reset_netlink support

2018-05-02 Thread Mike Christie
On 04/19/2018 02:46 AM, xiu...@redhat.com wrote: > @@ -1572,13 +1579,16 @@ static int tcmu_wait_genl_cmd_reply(struct tcmu_dev > *udev) > if (udev->nl_reply_supported <= 0) > return 0; > > + spin_lock(>nl_cmd_lock); > + nl_cmd->waiter++; I think this will allow

Re: [PATCHv4 1/3] target/configfs: add module wide action support

2018-05-02 Thread Mike Christie
On 04/19/2018 02:46 AM, xiu...@redhat.com wrote: > From: Xiubo Li > > For some case we need some module wide configfs to contol some > attributes of the whole transport module. When I suggested to move it module wide I just meant to add another mod param like the global max

Re: [RESEND V2 1/6] tcmu: add new netlink events helpers

2018-05-02 Thread Mike Christie
Thanks. Patchset looks ok to me. Acked-by: Mike Christie <mchri...@redhat.com> On 05/01/2018 10:13 PM, Zhu Lingshan wrote: > Add new netlink events helpers tcmu_netlink_event_init() and > tcmu_netlink_event_send(). These new functions intend to replace > exsiting netlink events

Re: [PATCHv3] tcmu: allow userspace to reset netlink

2018-04-17 Thread Mike Christie
[] SyS_write+0x7f/0xe0 > [] system_call_fastpath+0x16/0x1b > ====== > > Signed-off-by: Xiubo Li <xiu...@redhat.com> > --- > Changes since v1(suggested by Mike Christie): > v2: - Makes the reset per device. > v3: - Remove nl_cmd->complete, use status instead

Re: [PATCHv2] tcmu: allow userspace to reset netlink

2018-04-13 Thread Mike Christie
On 04/12/2018 10:08 PM, Xiubo Li wrote: > >>> + >>> +if (val != 1) { >>> +pr_err("Invalid block value %d\n", val); >> I think you wanted >> >> "Invalid reset value %d\n" > Yeah, just copied it from other place. >> >>> +return -EINVAL; >>> +} >>> + >>> +

Re: [PATCHv2] tcmu: allow userspace to reset netlink

2018-04-12 Thread Mike Christie
x1b > == > > Be careful of using this, it could reset the normal netlink requesting > operations, so we should use this only when the user space daemon from > starting and just before the daemon could receive and handle the nl > requests. > > Changes since v1(sugg

Re: [PATCH] tcmu: fix error resetting qfull_time_out to default

2018-04-12 Thread Mike Christie
static ssize_t tcmu_qfull_time_out_store(struct > config_item *item, > > if (val >= 0) { > udev->qfull_time_out = val * MSEC_PER_SEC; > + } else if (val == -1) { > + udev->qfull_time_out = val; > } else { > printk(KERN_ERR "Invalid qfull timeout value %d\n", val); > return -EINVAL; > Acked-by: Mike Christie <mchri...@redhat.com>

Re: [PATCH] tcmu: fix error resetting qfull_time_out to default

2018-04-12 Thread Mike Christie
On 04/10/2018 04:11 AM, Xiubo Li wrote: > > On 2018/4/9 19:44, Prasanna Kumar Kalever wrote: >> Problem: >> --- >> $ cat /sys/kernel/config/target/core/user_0/block/attrib/qfull_time_out >> -1 >> >> $ echo "-1" > >> /sys/kernel/config/target/core/user_0/block/attrib/qfull_time_out >> -bash:

Re: [PATCH] tcmu: allow userspace to reset netlink

2018-04-04 Thread Mike Christie
On 04/04/2018 09:38 PM, Xiubo Li wrote: > On 2018/4/5 8:47, Mike Christie wrote: >> On 04/02/2018 06:42 AM, xiu...@redhat.com wrote: >>> From: Xiubo Li <xiu...@redhat.com> >>> >>> This patch adds 1 tcmu attr to reset and complete all the blocked &

Re: [PATCH] tcmu: allow userspace to reset netlink

2018-04-04 Thread Mike Christie
On 04/02/2018 06:42 AM, xiu...@redhat.com wrote: > From: Xiubo Li > > This patch adds 1 tcmu attr to reset and complete all the blocked > netlink waiting threads. It's used when the userspace daemon like > tcmu-runner has crashed or forced to shutdown just before the > netlink

Re: [PATCH] libiscsi: ensure session spin lock usage consistent

2018-02-07 Thread Mike Christie
On 02/07/2018 04:41 PM, Mike Christie wrote: > >> static int iscsi_exec_task_mgmt_fn(struct iscsi_conn *conn, >> @@ -1908,7 +1908,7 @@ static enum blk_eh_timer_return >> iscsi_eh_cmd_timed_out(struct scsi_cmnd *sc) >> >> ISCSI_DBG_EH(sess

Re: [PATCH] libiscsi: ensure session spin lock usage consistent

2018-02-07 Thread Mike Christie
On 02/05/2018 01:13 PM, Lee Duncan wrote: > diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c > index 82c3fd4bc938..055357b2fe9e 100644 > --- a/drivers/scsi/libiscsi.c > +++ b/drivers/scsi/libiscsi.c > @@ -1248,9 +1248,9 @@ int iscsi_complete_pdu(struct iscsi_conn *conn, struct >

Re: [PATCH] libiscsi: ensure session spin lock usage consistent

2018-02-07 Thread Mike Christie
On 02/05/2018 01:13 PM, Lee Duncan wrote: > The libiscsi code was using both spin_lock()/spin_unlock() > and spin_lock_bh()/spin_unlock_bh() on its session lock. It does this because the lock was only taken between bottom halves and process contexts. If we are already in a bh then there is no

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

2018-01-11 Thread Mike Christie
sizeof(unsigned long), GFP_KERNEL); > - if (!udev->data_bitmap) > + if (!udev->data_bitmap) { > + ret = -ENOMEM; > goto err_bitmap_alloc; > + } > > udev->mb_addr = vzalloc(CMDR_SIZE); > if (!udev->mb_addr) { > Thanks. Acked-by: Mike Christie <mchri...@redhat.com>

Re: [PATCH] tcmu: Allow reconfig to handle multiple attributes

2018-01-10 Thread Mike Christie
On 01/04/2018 10:11 AM, Bryant G. Ly wrote: > This patch allows for multiple attributes to be reconfigured > and handled all in one call as compared to multiple netlinks. > > Example: > set attribute dev_reconfig=dev_config=fbo//home/path:dev_size=2147483648 > I know I suggested this, but I

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

2017-11-08 Thread Mike Christie
On 11/08/2017 04:39 PM, Bryant G. Ly wrote: > On 7/30/17 5:19 PM, Nicholas A. Bellinger wrote: > >> 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. >>>

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

2017-11-08 Thread Mike Christie
On 11/08/2017 04:35 PM, Bryant G. Ly wrote: > > On 7/30/17 5:10 PM, Nicholas A. Bellinger wrote: > >> 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

[PATCH 17/19] tcmu: make ring buffer timer configurable

2017-10-29 Thread Mike Christie
is too long to wait when some OSs like ESX will timeout commands after as little as 8 - 15 seconds. Signed-off-by: Mike Christie <mchri...@redhat.com> --- drivers/target/target_core_user.c | 131 +- 1 file changed, 101 insertions(+), 30 deletions(-) diff

[PATCH 18/19] tcmu: allow max block and global max blocks to be settable

2017-10-29 Thread Mike Christie
Users might have a physical system to a target so they could have a lot more than 2 gigs of memory they want to devote to tcmu. OTOH, we could be running in a vm and so a 2 gig global and 1 gig per dev limit might be too high. This patch allows the user to specify the limits. Signed-off-by: Mike

[PATCH 15/19] tcmu: simplify dbi thresh handling

2017-10-29 Thread Mike Christie
We do not really save a lot by trying to increase thresh a multiple of the existing value. This just simplifies the code by increasing it to whatever is needed for the command being executed. Signed-off-by: Mike Christie <mchri...@redhat.com> --- drivers/target/target_core_user.

[PATCH 05/19] tcmu: merge common block release code

2017-10-29 Thread Mike Christie
Have unmap_thread_fn use tcmu_blocks_release. Signed-off-by: Mike Christie <mchri...@redhat.com> --- drivers/target/target_core_user.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/target/target_core_user.c b/drivers/

[PATCH 11/19] tcmu: simplify scatter_data_area error handling

2017-10-29 Thread Mike Christie
scatter_data_area always returns 0, so stop checking for errors. Signed-off-by: Mike Christie <mchri...@redhat.com> --- drivers/target/target_core_user.c | 31 +++ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/drivers/target/target_core_use

[PATCH 19/19] target: return SAM_STAT_TASK_SET_FULL for TCM_OUT_OF_RESOURCES

2017-10-29 Thread Mike Christie
TCM_OUT_OF_RESOURCES is getting translated to TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE which seems like a heavy error when we just cannot allocate a resource that may be allocatable later. This has us translate TCM_OUT_OF_RESOURCES to SAM_STAT_TASK_SET_FULL instead. Signed-off-by: Mike Christie

[PATCH 12/19] tcmu: fix free block calculation

2017-10-29 Thread Mike Christie
The blocks_left calculation does not account for free blocks between 0 and thresh, so we could be queueing/waiting when there are enough blocks free. This has us add in the blocks between 0 and thresh as well as at the end from thresh to DATA_BLOCK_BITS. Signed-off-by: Mike Christie <mc

[PATCH 08/19] tcmu: move expired command completion to unmap thread

2017-10-29 Thread Mike Christie
though this is named irqcontrol it is not run in irq context)) and timer/bh context. In the timer/bh context bhs are disabled, so you need to use the _bh lock calls from the thread context callers. Signed-off-by: Mike Christie <mchri...@redhat.com> --- drivers/target/target_core_user.

[PATCH 06/19] tcmu: split unmap_thread_fn

2017-10-29 Thread Mike Christie
Separate unmap_thread_fn to make it easier to read. Signed-off-by: Mike Christie <mchri...@redhat.com> --- drivers/target/target_core_user.c | 120 ++ 1 file changed, 70 insertions(+), 50 deletions(-) diff --git a/drivers/target/target_core_user.c b/d

[PATCH 04/19] tcmu: fix double se_cmd completion

2017-10-29 Thread Mike Christie
and adding the cmd to the udev->commands idr until we have allocated ring space and are about to send the cmd to userspace. Signed-off-by: Mike Christie <mchri...@redhat.com> --- drivers/target/target_core_user.c | 54 ++- 1 file changed, 31 insertions(+), 23

[PATCH 16/19] tcmu: don't block submitting context for block waits

2017-10-29 Thread Mike Christie
here. 2. Devices were not fairly scheduled to run when they hit the global limit so they could time out waiting for ring space while others got run. Signed-off-by: Mike Christie <mchri...@redhat.com> --- drivers/target/target_core_user.c | 264 -- 1 file c

[PATCH 13/19] tcmu: clean up the scatter helper

2017-10-29 Thread Mike Christie
From: Xiubo Li <lixi...@cmss.chinamobile.com> Add some comments to make the scatter code to be more readable, and drop unused arg to new_iov. Signed-off-by: Xiubo Li <lixi...@cmss.chinamobile.com> Reviewed-by: Mike Christie <mchri...@redhat.com> Signed-off-by: Nicholas Bel

[PATCH 09/19] tcmu: remove commands_lock

2017-10-29 Thread Mike Christie
tcmu_handle_completions could be interrupted by a timer softirq while the commands_lock is held. Signed-off-by: Mike Christie <mchri...@redhat.com> --- drivers/target/target_core_user.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/

[PATCH 14/19] tcmu: prep queue_cmd_ring to be used by unmap wq

2017-10-29 Thread Mike Christie
In the next patch we will call queue_cmd_ring from the submitting context and also the unmap wq when blocks free. This changes the queue_cmd_ring return code so in the next patch we can return a sense_reason_t and also tell the caller if the cmd was internally queued. Signed-off-by: Mike Christie

[PATCH 01/19] tcmu: fix crash when removing the tcmu device v4

2017-10-29 Thread Mike Christie
lt and other places. Signed-off-by: Zhang Zhuoyu <zhangzhu...@cmss.chinamobile.com> Signed-off-by: Xiubo Li <lixi...@cmss.chinamobile.com> [ported to scsi branch] Signed-off-by: Mike Christie <mchri...@redhat.com> --- drivers/target/target_core_user.c | 92 -

[PATCH 00/19] target/target_core_user: changes for 4.16

2017-10-29 Thread Mike Christie
The following patches made over linus's tree, and also apply over Nicks target-pending master branch, and Martin and James's for-next branches, fix several bugs and add features to the target_core_user module for LIO. - Patches 1 -3 are target_core_user fixes/changes that have been sitting on the

[PATCH 03/19] tcmu: Use macro to call container_of in tcmu_cmd_time_out_show

2017-10-29 Thread Mike Christie
] Signed-off-by: Mike Christie <mchri...@redhat.com> --- drivers/target/target_core_user.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index fa251d3..1207b5b 100644 --- a/drivers/target/target

[PATCH 07/19] tcmu: fix unmap thread race

2017-10-29 Thread Mike Christie
of case. Signed-off-by: Mike Christie <mchri...@redhat.com> --- drivers/target/target_core_user.c | 43 +-- 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 15b54fd..1

[PATCH 02/19] tcmu: Add netlink command reply supported option for each device

2017-10-29 Thread Mike Christie
] Signed-off-by: Mike Christie <mchri...@redhat.com> --- drivers/target/target_core_user.c | 58 ++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 8b9ec0f..fa251d3 10

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

2017-08-03 Thread Mike Christie
list_for_each_entry_safe(udev, tmp, _udev_waiter, waiter) { > mutex_lock(>cmdr_lock); > if (udev->waiting_blocks < free_blocks) { > mutex_unlock(>cmdr_lock); > Thanks. Reviewed-by: Mike Christie <mchri...@redhat.com>

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

2017-07-13 Thread Mike Christie
On 07/13/2017 01:33 AM, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li <lixi...@cmss.chinamobile.com> > > Add some comments to make the scatter code to be more readable. > > Signed-off-by: Xiubo Li <lixi...@cmss.chinamobile.com> > --- Reviewed-by: Mike Christie <mchri...@redhat.com>

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

2017-07-12 Thread Mike Christie
udevs in waiter list, if the global free blocks available are > not enough, it will stop traversing the list and abort waking up the > others. > > Signed-off-by: Xiubo Li <lixi...@cmss.chinamobile.com> > Looks ok to me. Reviewed-by: Mike Christie <mchri...@redhat.com>

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

2017-07-12 Thread Mike Christie
tcmu_flush_dcache_range(from, copy_bytes); > - memcpy(to + sg->length - sg_remaining, from, > + memcpy(to + sg->length - sg_remaining, from + offset, > copy_bytes); > > sg_remaining -= copy_bytes; > Nice. Reviewed-by: Mike Christie <mchri...@redhat.com>

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

2017-07-11 Thread Mike Christie
On 07/11/2017 05:06 AM, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li <lixi...@cmss.chinamobile.com> > > Remove useless blank line and code and at the same time add one error > path to catch the errors. > > Signed-off-by: Xiubo Li <lixi...@cmss.chinamobile.com&g

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

2017-07-11 Thread Mike Christie
trace b7e5354cfb54d08b ]--- > > To fix this, just memset all the entry memory before using it, and > also to be more readable we adjust the bidi code. > > Fixed: fe25cc34795(tcmu: Recalculate the tcmu_cmd size to save cmd area > memories) > Reported-by: Bryant

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

2017-07-10 Thread Mike Christie
On 07/10/2017 12:36 AM, Damien Le Moal wrote: > Nicholas, Mike, > > On 7/7/17 15:05, Nicholas A. Bellinger wrote: >> Everything including MNC's #1-6 and your #1-2 be pushed to >> target-pending/for-next shortly. >> >> Please use this as your base for testing. :) > > I ran tests this morning

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

2017-07-07 Thread Mike Christie
On 07/06/2017 11:50 PM, 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: >>> If the user request handler completed the request with a CHECK CONDITION >&g

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

2017-07-05 Thread Mike Christie
t; > #include "target_core_ua.h" > > -DEFINE_MUTEX(device_mutex); > -LIST_HEAD(device_list); > +static DEFINE_MUTEX(device_mutex); > +static LIST_HEAD(device_list); > static DEFINE_IDR(devices_idr); > > static struct se_hba *lun0_hba; > My fault. Thanks. Reviewed-by: Mike Christie <mchri...@redhat.com>

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

2017-07-01 Thread Mike Christie
; > entry = (void *) mb + CMDR_OFF + cmd_head; > - tcmu_flush_dcache_range(entry, sizeof(*entry)); > tcmu_hdr_set_op(>hdr.len_op, TCMU_OP_CMD); > entry->hdr.cmd_id = tcmu_cmd->cmd_id; > entry->hdr.kflags = 0; > Looks ok to me. Reviewed-by: Mike Christie <mchri...@redhat.com>

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

2017-06-30 Thread Mike Christie
On 06/30/2017 03:14 AM, 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

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

2017-06-30 Thread Mike Christie
On 06/30/2017 11:58 AM, Mike Christie wrote: > On 06/30/2017 02:31 AM, Nicholas A. Bellinger wrote: >> 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, Ni

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

2017-06-30 Thread Mike Christie
On 06/30/2017 02:31 AM, Nicholas A. Bellinger wrote: > 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, >

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

2017-06-28 Thread Mike Christie
d)); > - if (cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) > - success = 1; > } > > + if (cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) > + success = 1; > + > /* >* Check for case where an explicit ABORT_TASK has been received >* and transport_wait_for_tasks() will be waiting for completion.. > Reviewed-by: Mike Christie <mchri...@redhat.com>

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

2017-06-28 Thread Mike Christie
t; gather_data_area(udev, cmd, true); > I have a patch similar to this and 5/5 in my set: https://www.spinics.net/lists/target-devel/msg15430.html If yours gets merged first then I will build my set over them, so patch looks ok to me. Reviewed-by: Mike Christie <mchri...@redhat.com>

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

2017-06-15 Thread Mike Christie
> + while (!kthread_should_stop()) { > DEFINE_WAIT(__wait); > > prepare_to_wait(_wait, &__wait, TASK_INTERRUPTIBLE); > Looks ok to me Reviewed-by: Mike Christie <mchri...@redhat.com>

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

2017-06-12 Thread Mike Christie
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. Ly wrote: >>> From: "Bryant G. Ly" <b...@us.ibm.com> >&g

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

2017-06-11 Thread Mike Christie
d. > The patches look ok. Thanks. Could you just merge the attached patch into "[PATCH v4 5/5] tcmu: Add Type of reconfig into netlink" or into the patchset after it? It just makes some of the names a little less generic and only returns the reconfig attr for reconfig commands. >From

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

2017-06-05 Thread Mike Christie
On 05/30/2017 01:31 PM, Bryant G. Ly wrote: > This patch adds more info about the attribute being changed, > so that usersapce can easily figure out what is happening. > > Signed-off-by: Bryant G. Ly > --- > drivers/target/target_core_user.c | 27

Re: [PATCH v2 4/5] tcmu: Make dev_config configurable

2017-06-05 Thread Mike Christie
On 05/30/2017 01:31 PM, Bryant G. Ly wrote: > This allows for userspace to change the device path after > it has been created. Thus giving the user the ability to change > the path. The use case for this is to allow for virtual optical > to have media change. > > Signed-off-by: Bryant G. Ly

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

2017-06-03 Thread Mike Christie
On 05/04/2017 09:51 PM, 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 the > first udevs in waiter list, if the

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

2017-05-31 Thread Mike Christie
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. >> > > Btw, after running DATERA's internal longevity and scale tests across > ~20 racks on v4.1.y with th

Re: [PATCH v1 3/4] tcmu: Make dev_size configurable via userspace

2017-05-29 Thread Mike Christie
On 05/26/2017 09:27 AM, Bryant G. Ly wrote: > Allow tcmu backstores to be able to set the device size > after it has been configured via set attribute. > > Part of support in userspace to support certain backstores > changing device size. > > Signed-off-by: Bryant G. Ly

Re: [PATCH v1 4/4] tcmu: Make dev_config configurable

2017-05-29 Thread Mike Christie
On 05/26/2017 09:27 AM, Bryant G. Ly wrote: > This allows for userspace to change the device path after > it has been created. Thus giving the user the ability to change > the path. The use case for this is to allow for virtual optical > to have media change. > > Signed-off-by: Bryant G. Ly

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

2017-05-26 Thread Mike Christie
Thanks for the patch. On 05/26/2017 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(sk); > > -

Re: [PATCH] tcmu: Recalculate the tcmu_cmd size to save cmd area memories

2017-05-02 Thread Mike Christie
culate them again when it make sure > how many iovs is needed before insert it to cmd area. > > Signed-off-by: Xiubo Li <lixi...@cmss.chinamobile.com> Looks ok to me. Thanks. Acked-by: Mike Christie <mchri...@redhat.com>

Re: [PATCH v6 2/2] tcmu: Add global data block pool support

2017-05-01 Thread Mike Christie
On 04/30/2017 06:29 AM, Xiubo Li wrote: > [...] >>> +static struct page *tcmu_try_get_block_page(struct tcmu_dev *udev, >>> uint32_t dbi) >>> +{ >>> +struct page *page; >>> +int ret; >>> + >>> +mutex_lock(>cmdr_lock); >>> +page = tcmu_get_block_page(udev, dbi); >>> +if

Re: [PATCH v6 1/2] tcmu: Add dynamic growing data area featuresupport

2017-05-01 Thread Mike Christie
On 04/30/2017 05:22 AM, Xiubo Li wrote: > On 2017年04月30日 13:48, Mike Christie wrote: >> On 04/26/2017 01:25 AM, lixi...@cmss.chinamobile.com wrote: >>> for_each_sg(data_sg, sg, data_nents, i) { >>> @@ -275,22 +371,26 @@ static void alloc_and_scatter_data_are

Re: [PATCH v6 2/2] tcmu: Add global data block pool support

2017-04-30 Thread Mike Christie
On 04/26/2017 01:25 AM, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > For each target there will be one ring, when the target number > grows larger and larger, it could eventually runs out of the > system memories. > > In this patch for each target ring,

Re: [PATCH v6 1/2] tcmu: Add dynamic growing data area feature support

2017-04-29 Thread Mike Christie
On 04/26/2017 01:25 AM, lixi...@cmss.chinamobile.com wrote: > for_each_sg(data_sg, sg, data_nents, i) { > @@ -275,22 +371,26 @@ static void alloc_and_scatter_data_area(struct tcmu_dev > *udev, > from = kmap_atomic(sg_page(sg)) + sg->offset; > while (sg_remaining

Re: RFC: remove REQ_OP_WRITE_SAME

2017-04-11 Thread Mike Christie
On 04/10/2017 11:07 AM, Christoph Hellwig wrote: > Now that we are using REQ_OP_WRITE_ZEROES for all zeroing needs in the > kernel there is very little use left for REQ_OP_WRITE_SAME. We only > have two callers left, and both just export optional protocol features > to remote systems: DRBD and

Re: [PATCH] target/user: PGR Support

2017-04-03 Thread Mike Christie
On 04/03/2017 12:20 AM, Shie-rei Huang wrote: > After a PGR command is processed in the kernel, is it possible for the > user mode to be notified with the command so that the user mode has a > chance to do its part of PGR processing. Below is one use case of it. > Suppose two TCMU servers are set

Re: [PATCHv5 2/2] tcmu: Fix wrongly calculating of the base_command_size

2017-03-28 Thread Mike Christie
i_data_nents + > - se_cmd->t_data_nents]), > + req.iov[tcmu_cmd_get_block_cnt(tcmu_cmd)]), > sizeof(struct tcmu_cmd_entry)); > command_size = base_command_size > + round_up(scsi_command_size(se_cmd->t_task_cdb), > TCMU_OP_ALIGN_SIZE); > Looks ok to me. Thanks. Reviewed-by: Mike Christie <mchri...@redhat.com>

Re: [PATCHv4 2/4] tcmu: Fix wrongly calculating of the base_command_size

2017-03-21 Thread Mike Christie
On 03/21/2017 04:36 AM, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > The t_data_nents and t_bidi_data_nents are the numbers of the > segments, but it couldn't be sure the block size equals to size > of the segment. > > For the worst case, all the blocks

Re: [PATCHv4 1/4] tcmu: Fix possible overwrite of t_data_sg's last iov[]

2017-03-21 Thread Mike Christie
_BIDI) { > + iov_cnt = 0; > + iov++; > + alloc_and_scatter_data_area(udev, se_cmd->t_bidi_data_sg, > + se_cmd->t_bidi_data_nents, , _cnt, > + false); > + entry->req.iov_bidi_cnt = iov_cnt; > + } > /* cmd's data_bitmap is what changed in process */ > bitmap_xor(tcmu_cmd->data_bitmap, old_bitmap, udev->data_bitmap, > DATA_BLOCK_BITS); > Patch looks ok to me. Reviewed-by: Mike Christie <mchri...@redhat.com>

Re: [PATCHv3 3/5] target/user: Fix possible overwrite of t_data_sg's last iov[]

2017-03-21 Thread Mike Christie
a_sg, > + se_cmd->t_bidi_data_nents, > + , _cnt, false); > + if (ret) { > + pr_err("tcmu: alloc and scatter bidi data failed\n"); > + return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; > + } > + entry->req.iov_bidi_cnt = iov_cnt; > } > - entry->req.iov_bidi_cnt = iov_cnt; > > /* All offsets relative to mb_addr, not start of entry! */ > cdb_off = CMDR_OFF + cmd_head + base_command_size; > Looks ok to me. Thanks. Reviewed-by: Mike Christie <mchri...@redhat.com>

Re: [PATCH] target/user: Add daynmic growing data area featuresupport

2017-02-28 Thread Mike Christie
On 02/27/2017 07:22 PM, Xiubo Li wrote: > Hi Mike > > Thanks verrry much for your work and test cases. > > > From: Xiubo Li > > Currently for the TCMU, the ring buffer size is fixed to 64K cmd > area + 1M data area, and this will be bottlenecks for

Re: [PATCH] target/user: Add daynmic growing data area feature support

2017-02-27 Thread Mike Christie
On 02/22/2017 02:32 PM, Andy Grover wrote: > On 02/17/2017 01:24 AM, lixi...@cmss.chinamobile.com wrote: >> > From: Xiubo Li >> > >> > Currently for the TCMU, the ring buffer size is fixed to 64K cmd >> > area + 1M data area, and this will be bottlenecks for high

Re: [PATCH] target/user: Fix use-after-free cmd->se_cmd if the cmd is expired

2017-01-03 Thread Mike Christie
On 01/03/2017 02:46 AM, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > This is another use-after-free bug, the crash Call Trace is like: > [ 368.909498] RIP: 0010:[] [] > memcpy+0x16/0x110 > .. > [ 368.909547] Call Trace: > [ 368.909550] []

Re: iscsi: make mutex for target scanning and unbinding per-session

2016-11-10 Thread Mike Christie
On 11/10/2016 07:13 PM, Chris Leech wrote: > On Thu, Nov 10, 2016 at 05:22:44PM -0600, Mike Christie wrote: >> > On 11/07/2016 12:22 PM, Chris Leech wrote: >>> > > Currently the iSCSI transport class synchronises target scanning and >>> > > unbinding w

Re: iscsi: make mutex for target scanning and unbinding per-session

2016-11-10 Thread Mike Christie
On 11/07/2016 12:22 PM, Chris Leech wrote: > Currently the iSCSI transport class synchronises target scanning and > unbinding with a host level mutex. For multi-session hosts (offloading > iSCSI HBAs) connecting to storage arrays that may implement one > target-per-lun, this can result in the

Re: [PATCHv2] MAINTAINERS: Update open-iscsi maintainers

2016-09-27 Thread Mike Christie
sertions(+), 3 deletions(-) > > diff --git a/MAINTAINERS b/MAINTAINERS > index 01bff8ea28d8..81384a2562e7 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -6448,10 +6448,10 @@ S:Maintained > F: drivers/firmware/iscsi_ibft* > > ISCSI > -M: Mike Christie <m

Re: [PATCH 02/28] be2iscsi: Replace _bh with _irqsave/irqrestore

2016-08-09 Thread Mike Christie
On 08/09/2016 03:29 AM, Jitendra Bhivare wrote: >> -Original Message- >> From: Martin K. Petersen [mailto:martin.peter...@oracle.com] >> Sent: Tuesday, August 09, 2016 6:35 AM >> To: Mike Christie >> Cc: Jitendra Bhivare; linux-scsi@vger.kernel.org >>

Re: [PATCH 02/28] be2iscsi: Replace _bh with _irqsave/irqrestore

2016-08-05 Thread Mike Christie
On 07/21/2016 04:07 AM, Jitendra Bhivare wrote: > Kernel panic - not syncing: Watchdog detected hard LOCKUP on cpu 21 > Pid: 13242, comm: flush-8:80 Tainted: GW -- > 2.6.32-573.el6.x86_64 #1 > Call Trace: > [] ? panic+0xa7/0x16f > [] ? sched_clock+0x9/0x10 > [] ?

Re: [PATCH 37/45] drivers: use req op accessor

2016-08-03 Thread Mike Christie
On 08/03/2016 07:30 PM, Shaun Tancheff wrote: > On Wed, Aug 3, 2016 at 6:47 PM, Mike Christie <mchri...@redhat.com> wrote: >> On 08/03/2016 05:33 PM, Ross Zwisler wrote: >>> On Sun, Jun 5, 2016 at 1:32 PM, <mchri...@redhat.com> wrote: >>>>

Re: [PATCH 37/45] drivers: use req op accessor

2016-08-03 Thread Mike Christie
On 08/03/2016 05:33 PM, Ross Zwisler wrote: > On Sun, Jun 5, 2016 at 1:32 PM, <mchri...@redhat.com> wrote: >> From: Mike Christie <mchri...@redhat.com> >> >> The req operation REQ_OP is separated from the rq_flag_bits >> definition. This converts the bloc

Re: [PATCH 42/45] block, fs, drivers: remove REQ_OP compat defs and related code

2016-08-03 Thread Mike Christie
On 08/03/2016 11:25 AM, Ross Zwisler wrote: > run fstests generic/008 at 2016-08-03 09:54:56 > page:ea0017af04c0 count:3 mapcount:0 mapping:8805eb059200 index:0x0 > flags: 0x3fff802828(uptodate|lru|private|writeback) > page dumped because: VM_BUG_ON_PAGE(!PageLocked(page)) >

Re: [PATCH 2/2] dm: call PR reserve/unreserve on each underlying device

2016-07-08 Thread Mike Christie
ey, > + .flags = flags, > + .fail_early = true, > + }; > + int ret; > + > + ret = dm_call_pr(bdev, __dm_pr_register, ); > + if (ret && new_key) { > + /* unregister all paths if we failed to register any path */ > +

Re: [PATCH 1/2] sd: don't use the ALL_TG_PT bit for reservations

2016-07-08 Thread Mike Christie
old_key, new_key, 0, > - (1 << 0) /* APTPL */ | > - (1 << 2) /* ALL_TG_PT */); > + (1 << 0) /* APTPL */); > } > > static int sd_pr_reserve(struct block_device *bdev, u64 key, enum pr_type > type, &

Re: [PATCH 28/45] target: use bio op accessors

2016-06-06 Thread Mike Christie
On 06/06/2016 01:46 AM, Hannes Reinecke wrote: > On 06/05/2016 09:32 PM, mchri...@redhat.com wrote: >> From: Mike Christie <mchri...@redhat.com> >> >> Separate the op from the rq_flag_bits and have the target layer >> set/get the bio using bio_set_op_attrs/

Re: [PATCH 4/5] scsi: add new async device reset support

2016-05-31 Thread Mike Christie
On 05/31/2016 02:38 PM, Mike Christie wrote: > On 05/30/2016 01:27 AM, Hannes Reinecke wrote: >> On 05/25/2016 09:55 AM, mchri...@redhat.com wrote: >>> From: Mike Christie <mchri...@redhat.com> >>> >>> Currently, if the SCSI eh runs then before we do a

Re: [PATCH 0/5] block/target queue/LUN reset support

2016-05-31 Thread Mike Christie
On 05/30/2016 01:37 AM, Hannes Reinecke wrote: > On 05/25/2016 09:54 AM, mchri...@redhat.com wrote: >> Currently, for SCSI LUN_RESETs the target layer can only wait on >> bio/requests it has sent. This normally results in the LUN_RESET >> timing out on the initiator side and that SCSI error

Re: [PATCH 4/5] scsi: add new async device reset support

2016-05-31 Thread Mike Christie
On 05/31/2016 02:38 PM, Mike Christie wrote: > On 05/30/2016 01:27 AM, Hannes Reinecke wrote: >> On 05/25/2016 09:55 AM, mchri...@redhat.com wrote: >>> From: Mike Christie <mchri...@redhat.com> >>> >>> Currently, if the SCSI eh runs then before we do a

Re: [PATCH 4/5] scsi: add new async device reset support

2016-05-31 Thread Mike Christie
On 05/30/2016 01:27 AM, Hannes Reinecke wrote: > On 05/25/2016 09:55 AM, mchri...@redhat.com wrote: >> From: Mike Christie <mchri...@redhat.com> >> >> Currently, if the SCSI eh runs then before we do a LUN_RESET >> we stop the host. This patch and the block la

Re: [PATCH 1/5] blk mq: take ref to q when running it

2016-05-25 Thread Mike Christie
wn while the queue_rq >> function is being run. >> >> This patch just has us do a blk_queue_enter call. >> >> Signed-off-by: Mike Christie <mchri...@redhat.com> >> --- >> block/blk-mq.c | 10 +- >> 1 file changed, 9 insertions(+), 1 dele

Re: [PATCH 1/5] blk mq: take ref to q when running it

2016-05-25 Thread Mike Christie
On 05/25/2016 02:15 PM, Mike Christie wrote: > On 05/25/2016 10:53 AM, Bart Van Assche wrote: >> On 05/25/2016 12:54 AM, mchri...@redhat.com wrote: >>> If the __blk_mq_run_hw_queue is a result of a async run or retry >>> then we do not have a reference

Re: [PATCH 2/5] block: add queue reset support

2016-05-25 Thread Mike Christie
On 05/25/2016 11:13 AM, Bart Van Assche wrote: > On 05/25/2016 12:55 AM, mchri...@redhat.com wrote: >> +spin_lock_irq(q->queue_lock); >> +wait_event_lock_irq(q->reset_wq, >> +!queue_flag_test_and_set(QUEUE_FLAG_RESETTING, q), >> +*q->queue_lock); >> +if

Re: [PATCH 2/2] target: fix max discard sectors calculation

2016-05-18 Thread Mike Christie
On 05/18/2016 11:56 AM, Bart Van Assche wrote: > On 05/17/2016 02:49 PM, Mike Christie wrote: >> --- a/drivers/target/target_core_device.c >> +++ b/drivers/target/target_core_device.c >> @@ -821,13 +821,15 @@ struct se_device *target_alloc_device(struct >> se

Re: [PATCH 2/2] target: fix max discard sectors calculation

2016-05-17 Thread Mike Christie
On 05/17/2016 01:16 PM, Bart Van Assche wrote: > On 05/16/2016 12:02 PM, Martin K. Petersen wrote: >>> "Bart" == Bart Van Assche writes: >> >> Bart> That's a good catch. But seeing this patch makes me wonder whether >> Bart> this patch introduces a 64-bit division?

Re: [PATCH 1/2] scsi: fix max discard sectors calculation

2016-05-16 Thread Mike Christie
On 05/16/2016 05:44 PM, Bart Van Assche wrote: > On 05/16/2016 11:46 AM, mchri...@redhat.com wrote: >> logical_block_size and max_blocks are 32 bits, so we can >> overflow when trying to convert SCSI device blocks to linux >> block layer sectors. >> >> Si

Re: [PATCH 2/2] target: fix max discard sectors calculation

2016-05-16 Thread Mike Christie
On 05/16/2016 01:57 PM, Bart Van Assche wrote: > On 05/16/2016 11:46 AM, mchri...@redhat.com wrote: >> diff --git a/drivers/target/target_core_device.c >> b/drivers/target/target_core_device.c >> index a4046ca..3f9f304 100644 >> --- a/drivers/target/target_core_device.c >> +++

Re: [Bug 118081] New: open-iscsi Ping timeout erro

2016-05-13 Thread Mike Christie
On 05/11/2016 10:34 PM, bugzilla-dae...@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=118081 > > Bug ID: 118081 >Summary: open-iscsi Ping timeout erro >Product: SCSI Drivers >Version: 2.5 > Kernel Version: 4.4.7 >

<    1   2   3   4   5   6   >