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

2018-05-07 Thread Bryant G. Ly
ved in a separate file, and it is another non-trivial >> task how to synchronize writing in two files, so that a following read >> operation always returns a consisten metadata for a specified block. >> >> v2: fix comments from Christoph Hellwig &

[PATCH v2] target: Fix Fortify_panic kernel exception

2018-04-17 Thread Bryant G. Ly
t/iblock: Convert WRITE_SAME to blkdev_issue_zeroout") Signed-off-by: Bryant G. Ly Reviewed-by: Steven Royer Tested-by: Taylor Jakobson Cc: Christoph Hellwig Cc: Nicholas Bellinger Cc: --- drivers/target/target_core_iblock.c | 8 1 file changed, 4 insertions(+), 4 deletions(-)

Re: [PATCH] target: Fix Fortify_panic kernel exception

2018-04-17 Thread Bryant G. Ly
On 4/13/18 11:44 AM, Christoph Hellwig wrote: > The patch looks fine, but in general I think descriptions of what > you fixed in the code or more important than starting out with > a backtrace. > > E.g. please explain what was wrong, how you fixed it and only after > that mention how it was caugh

[PATCH] target: Fix Fortify_panic kernel exception

2018-04-12 Thread Bryant G. Ly
r than the size of the data passed in from ptr1 or ptr2 then a fortify_panic is posted. Fixes: 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout") Signed-off-by: Bryant G. Ly Reviewed-by: Steven Royer Tested-by: Taylor Jakobson Cc: Christoph Hellwig Cc: Nichol

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

2018-03-22 Thread Bryant G. Ly
This patch created the helpers for f_op->read/write: https://patchwork.kernel.org/patch/9580365/ That patch was queued up for 4.11 so I guess if anyone tried to port this patch back they would hit issues if they didn't use f_op. Reviewed-by: Bryant G. Ly -Bryant

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

2018-03-15 Thread Bryant G. Ly
A. Bellinger" > Signed-off-by: Andrei Vagin > --- > drivers/target/target_core_file.c | 124 > -- > drivers/target/target_core_file.h | 1 + > 2 files changed, 120 insertions(+), 5 deletions(-) > > Tested-by: Bryant G. Ly Patch

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

2018-01-29 Thread Bryant G. Ly
On 1/10/18 12:26 PM, Mike Christie wrote: > 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=d

[PATCH] tcmu: Allow reconfig to handle multiple attributes

2018-01-04 Thread Bryant G. Ly
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 Signed-off-by: Bryant G. Ly --- drivers/target/target_core_user.c | 92

[PATCH] ibmvscsis: add DRC indices to debug statements

2017-12-04 Thread Bryant G. Ly
Where applicable, changes pr_debug, pr_info, pr_err, etc. calls to the dev_* versions. This adds the DRC index of the device to the corresponding trace statement. Signed-off-by: Bryant G. Ly Signed-off-by: Brad Warrum --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 320

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

2017-11-14 Thread Bryant G. Ly
On 4/12/17 12:30 AM, 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 >> instead. >> > The people who are actively using iblock_execute_write_same_direct() are > doing so in the context of ES

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

2017-11-08 Thread Bryant G. Ly
> 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 t

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

2017-11-08 Thread Bryant G. Ly
On 8/6/17 6:27 PM, Nicholas A. Bellinger wrote: > 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 wa

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

2017-11-08 Thread Bryant G. Ly
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. >> >> Signed-off-by: Xiubo Li >> --- >> drivers/target/target_core_user.c | 30 ++

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

2017-11-08 Thread Bryant G. Ly
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 >> >> The fifo type waiter list will hold the udevs who are waiting for the >> blocks

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

2017-11-08 Thread Bryant G. Ly
ansport_complete_task_attr(), and avoid updating SCSI task > attribute related counters for any subsequent calls. > > Also, when a se_cmd is deferred due to ordered tags and executed > via target_restart_delayed_cmds(), set CMD_T_SENT before execution > matching what target_execute_cmd(

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

2017-11-08 Thread Bryant G. Ly
> To address this bug, this patch adds a CMD_T_STOP|CMD_T_ABORTED > check within transport_write_pending_qf() and invokes the > existing se_cmd->t_transport_stop_comp to signal quiese > completion back to __transport_wait_for_tasks(). > > Cc: Mike Christie > Cc: Hannes Re

Re: [PATCH] ibmvscsis: Fix write_pending failure path

2017-10-03 Thread Bryant G. Ly
On 10/2/17 9:51 PM, Martin K. Petersen wrote: Bryant, For write_pending if the queue is down or client failed then return -EIO so that LIO can properly process the completed command. Prior we returned 0 since LIO could not handle it properly. Now with: target: Fix unknown fabric callback queu

[PATCH] ibmvscsis: Fix write_pending failure path

2017-10-02 Thread Bryant G. Ly
From: "Bryant G. Ly" For write_pending if the queue is down or client failed then return -EIO so that LIO can properly process the completed command. Prior we returned 0 since LIO could not handle it properly. Now with: target: Fix unknown fabric callback queue-full errors that patch

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

2017-07-11 Thread Bryant G. Ly
ore 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 G. Ly Tested-by: Damien Le Moal Signed-off-by: Xiubo Li --- drivers/target/target_core_user.c |

Re: [PATCH 0/5] target: Zoned block device support and bug fixes

2017-06-28 Thread Bryant G. Ly
This series introduce zoned block device support for the pscsi backstore and also fixes several problems with sense data handling for failed requests. The first patch is only a cleanup, so not really necessary but nice to have I think. Patch 2 and 3 introduce support for host managed zoned blo

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

2017-06-08 Thread Bryant G. Ly
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+ vms. That is how we discovered the bug in the first place. -Bryant

Re: [PATCH 2/7] scsi: ibmvscsi_tgt: remove use of class_attrs

2017-06-08 Thread Bryant G. Ly
The class_attrs pointer is going away and it's not even being used in this driver, so just remove it entirely. Cc: "Bryant G. Ly" Cc: Michael Cyr Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: Cc: Signed-off-by: Greg Kroah-Hartman --- drive

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

2017-06-06 Thread Bryant G. Ly
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. Signed-off-by: Bryant G. Ly Signed-off-by: Mike Christie

[PATCH v4 3/5] tcmu: Make dev_size configurable via userspace

2017-06-06 Thread Bryant G. Ly
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 --- drivers/target/target_core_user.c | 59

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

2017-06-06 Thread Bryant G. Ly
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 | 20 ++-- include/uapi/linux/target_core_user.h | 8 2 files changed, 22

[PATCH v4 4/5] tcmu: Make dev_config configurable

2017-06-06 Thread Bryant G. Ly
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 --- drivers/target/target_core_user.c | 41

[PATCH v4 2/5] tcmu: Add netlink for device reconfiguration

2017-06-06 Thread Bryant G. Ly
This gives tcmu the ability to handle events that can cause reconfiguration, such as resize, path changes, write_cache, etc... Signed-off-by: Bryant G. Ly Reviewed-By: Mike Christie --- drivers/target/target_core_user.c | 12 include/uapi/linux/target_core_user.h | 1 + 2

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

2017-06-06 Thread Bryant G. Ly
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 device path. V2 - Fixes kfree in tcmu: Make dev_config configurable V3 - Fixe

[PATCH v4 1/5] tcmu: Support emulate_write_cache

2017-06-06 Thread Bryant G. Ly
This will enable the toggling of write_cache in tcmu through targetcli-fb Signed-off-by: Bryant G. Ly Reviewed-By: Mike Christie --- drivers/target/target_core_user.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/target/target_core_user.c b

[PATCH v3 4/5] tcmu: Make dev_config configurable

2017-05-31 Thread Bryant G. Ly
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. v3 - Fix kree spelling error to kfree Signed-off-by: Bryant G. Ly --- drivers/target

[PATCH v2 1/5] tcmu: Support emulate_write_cache

2017-05-30 Thread Bryant G. Ly
This will enable the toggling of write_cache in tcmu through targetcli-fb Signed-off-by: Bryant G. Ly Reviewed-By: Mike Christie --- drivers/target/target_core_user.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/target/target_core_user.c b

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

2017-05-30 Thread Bryant G. Ly
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 +-- include/uapi/linux/target_core_user.h | 1 + 2 files changed, 22

[PATCH v2 0/5] TCMU Enable Reconfiguration Patches

2017-05-30 Thread 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 device path. Bryant G. Ly (5): tcmu: Support emulate_write_cache tcmu: Add netlink for device

[PATCH v2 2/5] tcmu: Add netlink for device reconfiguration

2017-05-30 Thread Bryant G. Ly
This gives tcmu the ability to handle events that can cause reconfiguration, such as resize, path changes, write_cache, etc... Signed-off-by: Bryant G. Ly Reviewed-By: Mike Christie --- drivers/target/target_core_user.c | 12 include/uapi/linux/target_core_user.h | 1 + 2

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

2017-05-30 Thread Bryant G. Ly
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 --- drivers/target/target_core_user.c | 41

[PATCH v2 3/5] tcmu: Make dev_size configurable via userspace

2017-05-30 Thread Bryant G. Ly
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 --- drivers/target/target_core_user.c | 59

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

2017-05-26 Thread Bryant G. Ly
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 --- drivers/target/target_core_user.c | 40

[PATCH v1 1/4] tcmu: Support emulate_write_cache

2017-05-26 Thread Bryant G. Ly
This will enable the toggling of write_cache in tcmu through targetcli-fb Signed-off-by: Bryant G. Ly Reviewed-By: Mike Christie --- drivers/target/target_core_user.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/target/target_core_user.c b

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

2017-05-26 Thread Bryant G. Ly
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 --- drivers/target/target_core_user.c | 59

[PATCH v1 0/4] TCMU Enable Reconfiguration Patches

2017-05-26 Thread 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 device path. Bryant G. Ly (4): tcmu: Support emulate_write_cache tcmu: Add netlink for device

[PATCH v1 2/4] tcmu: Add netlink for device reconfiguration

2017-05-26 Thread Bryant G. Ly
This gives tcmu the ability to handle events that can cause reconfiguration, such as resize, path changes, write_cache, etc... Signed-off-by: Bryant G. Ly Reviewed-By: Mike Christie --- drivers/target/target_core_user.c | 12 include/uapi/linux/target_core_user.h | 1 + 2

[PATCH] ibmvscsis: Enable Logical Partition Migration Support

2017-05-16 Thread Bryant G. Ly
let phyp know once we're ready for the Suspend. Signed-off-by: Michael Cyr Signed-off-by: Bryant G. Ly --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 148 --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h | 25 +- drivers/scsi/ibmvscsi_tgt/libsrp.h | 5

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

2017-05-11 Thread Bryant G. Ly
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 aborted task response")' This patch cleans up some pointers after usage. Signed-off-by: Bryan

[PATCH v2] ibmvscsis: Fix the incorrect req_lim_delta

2017-05-10 Thread Bryant G. Ly
at it can send a new command, and we could find ourselves short of command elements. Not likely, but could happen. This patch depends on both: commit 25e78531268e ("ibmvscsis: Do not send aborted task response") commit 38b2788edbd6 ("ibmvscsis: Clear left-over abort_cmd pointers&q

[PATCH v1] ibmvscsis: Fix the incorrect req_lim_delta

2017-05-10 Thread Bryant G. Ly
ed-off-by: Bryant G. Ly Reviewed-by: Michael Cyr Cc: # v4.8+ --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c index e

[PATCH v1] ibmvscsis: Fix cleaning up pointers

2017-05-09 Thread Bryant G. Ly
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 Cc: # v4.8+ --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 3 ++

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

2017-05-08 Thread Bryant G. Ly
to reset the cmd->abort_cmd pointer after finding it in send_messages. Cc: # v4.8+ Signed-off-by: Bryant G. Ly Signed-off-by: Michael Cyr --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 117 --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h | 2 + 2 files changed, 94 i

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

2017-05-05 Thread Bryant G. Ly
v4.8+ Signed-off-by: Bryant G. Ly Signed-off-by: Michael Cyr --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 114 --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h | 2 + 2 files changed, 91 insertions(+), 25 deletions(-) diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt

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

2017-05-04 Thread Bryant G. Ly
On 5/3/17 1:55 PM, Bryant G. Ly wrote: On 5/3/17 11:38 AM, Bryant G. Ly wrote: Hi Nick, On 5/2/17 10:43 PM, Nicholas A. Bellinger wrote: On Tue, 2017-05-02 at 13:54 -0500, Bryant G. Ly wrote: The driver is sending a response to the actual scsi op that was aborted by an abort task TM

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

2017-05-03 Thread Bryant G. Ly
On 5/3/17 11:38 AM, Bryant G. Ly wrote: Hi Nick, On 5/2/17 10:43 PM, Nicholas A. Bellinger wrote: On Tue, 2017-05-02 at 13:54 -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

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

2017-05-03 Thread Bryant G. Ly
Hi Nick, On 5/2/17 10:43 PM, Nicholas A. Bellinger wrote: On Tue, 2017-05-02 at 13:54 -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

[PATCH v2] ibmvscsis: Do not send aborted task response

2017-05-02 Thread Bryant G. Ly
SCSI spec says that the initiator that sends the abort task TM NEVER gets a response to the aborted op and with the current code it will send a response. Thus this fix will remove that response if the TAS bit is set. Cc: # v4.8+ Signed-off-by: Bryant G. Ly Reviewed-by: Tyrel Datwyler --- drivers

[PATCH v3] target/user: PGR Support

2017-04-21 Thread Bryant G. Ly
This adds initial PGR support for just TCMU, since tcmu doesn't have the necessary IT_NEXUS info to process PGR in userspace, so have those commands be processed in kernel. HA support is not available yet, we will work on it if this patch is acceptable. Signed-off-by: Bryant G. Ly --- dr

[PATCH v2] target/user: PGR Support

2017-04-21 Thread Bryant G. Ly
This adds initial PGR support for just TCMU, since tcmu doesn't have the necessary IT_NEXUS info to process PGR in userspace, so have those commands be processed in kernel. HA support is not available yet, we will work on it if this patch is acceptable. Signed-off-by: Bryant G. Ly --- dr

[PATCH] target: Add WRITE_VERIFY_16

2017-04-18 Thread Bryant G. Ly
This patch addresses clients who needs write_verify_16 for large volume groups such as AIX. Signed-off-by: Bryant G. Ly --- drivers/target/target_core_sbc.c | 2 ++ include/scsi/scsi_proto.h| 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/target/target_core_sbc.c b/drivers

[PATCH] ibmvscsis: Do not send aborted task response

2017-04-10 Thread Bryant G. Ly
s the abort task TM NEVER gets a response to the aborted op and with the current code it will send a response. Thus this fix will remove that response if the TAS bit is set. Cc: # v4.8+ Signed-off-by: Bryant G. Ly --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 60 +--- 1

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

2017-04-07 Thread Bryant G. Ly
On 4/7/17 11:36 AM, Bart Van Assche wrote: On Fri, 2017-04-07 at 11:12 -0500, Bryant G. Ly wrote: So from this stack trace it looks like the ibmvscsis driver is sending an extra response through send_messages even though an abort was issued. IBMi, reported this issue internally when they were

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

2017-04-07 Thread Bryant G. Ly
On 4/7/17 10:49 AM, Bryant G. Ly wrote: The driver is sending a response to the aborted task response along with LIO sending the tmr response. SCSI spec says that the initiator that sends the abort task TM NEVER gets a response to the aborted op and with the current code it will send a

[PATCH] ibmvscsis: Do not send aborted task response

2017-04-07 Thread Bryant G. Ly
if the op is aborted. Cc: # v4.8+ Signed-off-by: Bryant G. Ly --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 60 +--- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h | 1 + 2 files changed, 40 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/ibmvscsi_tgt

[PATCH] target/user: PGR Support

2017-03-30 Thread Bryant G. Ly
This adds PGR support for just TCMU, since tcmu doesn't have the necessary IT_NEXUS info to process PGR in userspace, so have those commands be processed in kernel. Signed-off-by: Bryant G. Ly --- drivers/target/target_core_configfs.c | 10 +- drivers/target/target_core_device.c

Re: [PATCHv4 0/4] tcmu: bug fix and dynamic growing data area support

2017-03-21 Thread Bryant G. Ly
On 3/21/17 3:36 AM, lixi...@cmss.chinamobile.com wrote: From: Xiubo Li Changed for V4: - re-order the #3, #4 at the head. - merge most of the #5 to others. Changed for V3: - [PATCHv2 2/5] fix double usage of blocks and possible page fault call trace. - [PATCHv2 5/5] fix a mistake. Changed

Re: [PATCHv2 5/5] target/user: Clean up tcmu_queue_cmd_ring

2017-03-16 Thread Bryant G. Ly
From: Xiubo Li Add two helpers to simplify the code, and move some code out of the cmdr spin lock to reduce the size of critical region. Signed-off-by: Xiubo Li --- drivers/target/target_core_user.c | 54 ++- 1 file changed, 30 insertions(+), 24 deletio

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

2017-03-16 Thread Bryant G. Ly
ointer and length So this fix would be great! Signed-off-by: Bryant G. Ly

Re: [PATCH] target: Fix NULL dereference during LUN lookup + active I/O shutdown

2017-02-23 Thread Bryant G. Ly
From: Nicholas Bellinger When transport_clear_lun_ref() is shutting down a se_lun via configfs with new I/O in-flight, it's possible to trigger a NULL pointer dereference in transport_lookup_cmd_lun() due to the fact percpu_ref_get() doesn't do any __PERCPU_REF_DEAD checking before incrementin

[PATCH] target: Add WRITE_VERIFY_16 Support

2017-01-27 Thread Bryant G. Ly
For clients who want to utilize more than 2GB you need WRITE AND VERIFY 16 support. Reported-by: Michael Cyr Signed-off-by: Bryant G. Ly --- drivers/target/target_core_sbc.c | 1 + include/scsi/scsi_proto.h| 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/target

Re: [PATCH] target: Add WRITE_VERIFY_16 Support

2017-01-27 Thread Bryant G. Ly
On Fri, 2017-01-27 at 14:49 -0600, Bryant G. Ly wrote: For clients who want to utilize more than 2GB you need WRITE AND VERIFY 16 support. Hello Bryant, This patch introduces a bug for WRITE AND VERIFY(16) parsing that already exists for WRITE AND VERIFY(10) parsing, namely that the value of

[PATCH] ibmvscsis: Fix max transfer length

2017-01-11 Thread Bryant G. Ly
Current code incorrectly calculates the max transfer length, since it is assuming a 4k page table, but ppc64 all run on 64k page tables. Cc: sta...@vger.kernel.org Reported-by: Steven Royer Tested-by: Steven Royer Signed-off-by: Bryant G. Ly --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 3

[PATCH] ibmvscsis: Fix max transfer length

2017-01-11 Thread Bryant G. Ly
Current code incorrectly calculates the max transfer length, since it is assuming a 4k page table, but ppc64 all run on 64k page tables. Cc: sta...@vger.kernel.org Reported-by: Steven Royer Tested-by: Steven Royer Signed-off-by: Bryant G. Ly --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 3

[PATCH] ibmvscsis: Fix max transfer length

2017-01-11 Thread Bryant G. Ly
Current code incorrectly calculates the max transfer length, since it is assuming a 4k page table, but ppc64 all run on 64k page tables. Cc: sta...@vger.kernel.org Reported-by: Steven Royer Tested-by: Steven Royer Signed-off-by: Bryant G. Ly --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 3

Re: [PATCH] ibmvscsis: Fix max transfer length

2017-01-11 Thread Bryant G. Ly
On 1/11/17 12:57 PM, Bart Van Assche wrote: On Wed, 2017-01-11 at 12:02 -0600, Bryant G. Ly wrote: Current code incorrectly calculates the max transfer length, since it is assuming a 4k page table, but ppc64 all run on 64k page tables. Cc: sta...@vger.kernel.org Reported-by: Steven Royer

[PATCH] ibmvscsis: fix sleeping in interrupt context

2017-01-11 Thread Bryant G. Ly
Currently, dma_alloc_coherent is being called with a GFP_KERNEL flag which allows it to sleep in an interrupt context, need to change to GFP_ATOMIC. Cc: sta...@vger.kernel.org Tested-by: Steven Royer Reviewed-by: Michael Cyr Signed-off-by: Bryant G. Ly --- drivers/scsi/ibmvscsi_tgt

[PATCH] ibmvscsis: Fix max transfer length

2017-01-11 Thread Bryant G. Ly
Current code incorrectly calculates the max transfer length, since it is assuming a 4k page table, but ppc64 all run on 64k page tables. Cc: sta...@vger.kernel.org Reported-by: Steven Royer Tested-by: Steven Royer Signed-off-by: Bryant G. Ly --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2

Re: [PATCH] ibmvscsis: Fix srp_transfer_data fail return code

2017-01-09 Thread Bryant G. Ly
On 1/9/17 10:47 AM, Greg KH wrote: On Mon, Jan 09, 2017 at 10:21:20AM -0600, Bryant G. Ly wrote: From: "Bryant G. Ly" If srp_transfer_data fails within ibmvscsis_write_pending, then the most likely scenario is that the client timed out the op and removed the TCE mapping. Thus it

[PATCH] ibmvscsis: Fix srp_transfer_data fail return code

2017-01-09 Thread Bryant G. Ly
From: "Bryant G. Ly" If srp_transfer_data fails within ibmvscsis_write_pending, then the most likely scenario is that the client timed out the op and removed the TCE mapping. Thus it will loop forever retrying the op that is pretty much guaranteed to fail forever. A better return cod

Re: [PATCH v1 1/3] Synchronization of cmds during termination conditions

2016-10-12 Thread Bryant G. Ly
On 10/11/16 5:58 PM, Michael Cyr wrote: Signed-off-by: Michael Cyr --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 1082 +- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h |5 +- 2 files changed, 486 insertions(+), 601 deletions(-) I would make the first patch reor

[PATCH v1] Ibmvscsis: Fixed unused variable

2016-09-16 Thread Bryant G. Ly
Signed-off-by: Bryant G. Ly --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c index b29fef9..f8ba2a0 100644 --- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +++ b

[PATCH v1 2/3] Ibmvscsis: Code cleanup of print statements

2016-08-31 Thread Bryant G. Ly
Signed-off-by: Bryant G. Ly Signed-off-by: Michael Cyr --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 26 ++ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c index a515cdd

[PATCH v1 3/3] Ibmvscsis: Fixed a bug reported by Dan Carpenter

2016-08-31 Thread Bryant G. Ly
SUPPORTED_FORMATS is 1 << 1 so it's never zero. Signed-off-by: Bryant G. Ly Signed-off-by: Michael Cyr --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/i

[PATCH v1 1/3] Ibmvscsis: Properly deregister target sessions

2016-08-31 Thread Bryant G. Ly
The driver currently doesn't properly deregisters target sessions completely, so this will address that. Signed-off-by: Bryant G. Ly Signed-off-by: Michael Cyr --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/ibmvscs

[PATCH v1 0/3] Ibmvscsis fixes and code cleanup

2016-08-31 Thread Bryant G. Ly
Here are some small fixes and cleanups for Ibmvscsis Target Driver. The only one of significance is the first one where there is a possibility of a kernel crash due to inproper deregister of target session since we didn't sync up work and didn't deregister_configfs. Bryant G. Ly (3):

Re: [PATCH -next] ibmvscsis: Use list_move_tail instead of list_del/list_add_tail

2016-08-26 Thread Bryant G. Ly
On 7/22/16, 9:03 AM, "Wei Yongjun" wrote: Using list_move_tail() instead of list_del() + list_add_tail(). Signed-off-by: Wei Yongjun --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) Looks good to me. -- To unsu

Re: [PATCH v9] ibmvscsis: Initial commit of IBM VSCSI Tgt Driver

2016-07-20 Thread Bryant G. Ly
Hi Nic, < SNIP > > Note the deletion of drivers/scsi/libsrp.c + include/scsi/libsrp.h has > been dropped from the above commit, as it looks like they where changes > specific to your local tree. > Please have a quick look, and let me know if anything doesn't look > right

[PATCH] target: Unsupported SCSI Opcode Fix

2016-06-30 Thread Bryant G. Ly
and with an Ordered Task is sent, it causes a hang, since dev->simple_cmds is at -1. Signed-off-by: Michael Cyr Signed-off-by: Bryant G. Ly --- drivers/target/target_core_transport.c | 6 ++ include/target/target_core_base.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff -

Re: [PATCH v8] ibmvscsis: Initial commit of IBM VSCSI Tgt Driver

2016-06-29 Thread Bryant G. Ly
On 6/29/16, 9:54 AM, "Bart Van Assche" wrote: On 06/29/2016 04:43 PM, Bryant G. Ly wrote: >> It looks like the masking fixes the device mapper’s ability to find the >> disk…. > Is the multipath client available in your initrd? If so, running > multipath -ll -v w

Re: [PATCH v8] ibmvscsis: Initial commit of IBM VSCSI Tgt Driver

2016-06-29 Thread Bryant G. Ly
On 6/29/16, 12:49 AM, "Bart Van Assche" wrote: >> I was hoping someone in the community can help answer this: >> >> If I were to remove the masking off of the lun addressing method prior to >> target_submit_cmd/target_submit_tmr then I get a hang within scsi probe >> on bootup. (srp->lun.scsi_

Re: [PATCH v8] ibmvscsis: Initial commit of IBM VSCSI Tgt Driver

2016-06-28 Thread Bryant G. Ly
On 6/27/16, 3:17 PM, "Michael Cyr" wrote: + cmd->se_cmd.tag = be64_to_cpu(srp->tag); + + spin_lock_bh(&vscsi->intr_lock); + list_add_tail(&cmd->list, &vscsi->active_q); + spin_unlock_bh(&vscsi->intr_lock); + + srp->lun.scsi_lun[0] &= 0x3f; + + pr_debug("cal

Re: [PATCH v7] ibmvscsis: Initial commit of IBM VSCSI Tgt Driver

2016-06-23 Thread Bryant G. Ly
on (san...@us.ibm.com) IBM Corp. >> + * Linda Xie (l...@us.ibm.com) IBM Corp. >> + * >> + * Copyright (C) 2005-2011 FUJITA Tomonori >> + * Copyright (C) 2010 Nicholas A. Bellinger >> + * Copyright (C) 2016 Bryant G. Ly IBM Corp. >> + * &

Re: [PATCH v4] ibmvscsis: Initial commit of IBM VSCSI Tgt Driver

2016-06-15 Thread Bryant G. Ly
On 6/14/16, 9:57 AM, "Christoph Hellwig" wrote: >On Tue, Jun 14, 2016 at 10:46:09AM +0200, Bart Van Assche wrote: >> All what's needed is something like the (untested) patch below. As one >> can see no new function pointers have been added to target_core_fabric_ops. >> All that has been added are

Re: [PATCH v4] ibmvscsis: Initial commit of IBM VSCSI Tgt Driver

2016-06-15 Thread Bryant G. Ly
On 6/14/16, 3:46 AM, "Bart Van Assche" wrote: >On 06/14/2016 08:35 AM, Nicholas A. Bellinger wrote: >> On Fri, 2016-06-10 at 12:05 -0700, Bart Van Assche wrote: >>> On 06/09/2016 02:26 PM, Bryant G. Ly wrote: >>>> +/** >>>> + *

Re: [PATCH v4] ibmvscsis: Initial commit of IBM VSCSI Tgt Driver

2016-06-15 Thread Bryant G. Ly
On 6/14/16, 3:09 AM, "Bart Van Assche" wrote: >On 06/09/2016 11:26 PM, Bryant G. Ly wrote: >> This driver is a pick up of the old IBM VIO scsi Target Driver >> that was started by Nick and Fujita 2-4 years ago. >> http://comments.gmane.org/gmane.linux.scsi/90119

[PATCH] target: Fix for hang of Ordered task in TCM

2016-06-08 Thread Bryant G. Ly
rdered task attribute is sent, target_handle_task_attr sees that dev->simple_cmds is not 0, so it decides it can't execute the command until all the (nonexistent) Simple commands have completed. Reported-by: Michael Cyr Signed-off-by: Nicholas Bellinger Signed-off-by: Bryant G. Ly ---

[PATCH v3] ibmvscsis: Initial commit of IBM VSCSI Tgt Driver

2016-05-27 Thread Bryant G. Ly
wyler Signed-off-by: Bryant G. Ly --- MAINTAINERS | 10 + drivers/scsi/Kconfig | 27 +- drivers/scsi/Makefile|2 +- drivers/scsi/ibmvscsi/Makefile |4 + drivers/scsi/ibmvscsi/ibmvscsi

[PATCH v2] ibmvscsis: Initial commit of IBM VSCSI Tgt Driver

2016-05-26 Thread Bryant G. Ly
dma allocation. Lastly, this disregards my previous post splitting up the changes into patches, and makes them ammends with different versions of the original patch. This patch also contains internal IBM sign offs. Signed-off-by: Bryant G. Ly Signed-off-by: Steven Royer Signed-off-by: Tyrel Dat

[PATCH 2/3] ibmvscsis: Addressing Bart's comments

2016-05-25 Thread Bryant G. Ly
From: bryantly This patch contains cleaning up the code for styling and also addresses Bart's comments. Signed-off-by: bryantly --- MAINTAINERS | 4 +- drivers/scsi/Kconfig | 36 +-- drivers/scsi/Makefile | 4 +- drivers/scsi/ibmvscsi/Makefi

[PATCH 3/3] ibmvscsis: clean up functions

2016-05-25 Thread Bryant G. Ly
From: bryantly This patch removes forward declarations and re-organizes the functions within the driver. This patch also fixes MAINTAINERS for ibmvscsis. Signed-off-by: bryantly --- MAINTAINERS |4 +- drivers/scsi/ibmvscsi/ibmvscsis.c | 2709 ++

IBM VSCSI Target Driver Initial Patch Sets

2016-05-25 Thread Bryant G. Ly
This patch series addresses comments by Joe with runing checkpatch with a --strict. It cleans up all the misc styling and removes all the forward declarations. The patch also addresses all of Bart's comments besides the preallocation of buffers before IO starts and the merging of unpack_lun with s

Re: [PATCH] ibmvscsis: Initial commit of IBM VSCSI Tgt Driver

2016-05-24 Thread Bryant G Ly
Quoting Bart Van Assche : On 05/24/2016 06:52 AM, Bryant G. Ly wrote: +config SCSI_IBMVSCSIS + tristate "IBM Virtual SCSI Server support" + depends on PPC_PSERIES && SCSI_SRP && TARGET_CORE + help + This is the IBM POWER Virtual SCSI Targ

[PATCH] ibmvscsis: Initial commit of IBM VSCSI Tgt Driver

2016-05-24 Thread Bryant G. Ly
Device Target Driver +M: Bryant G. Ly +L: linux-scsi@vger.kernel.org +L: target-de...@vger.kernel.org +S: Supported +F: drivers/scsi/ibmvscsi/ibmvscsis.c +F: drivers/scsi/ibmvscsi/ibmvscsis.h +F: drivers/scsi/libsrp.h +F: drivers/scsi/libsrp.c + IBM Power Virtual

Re: [PATCH] Fix for hang of Ordered task in TCM

2016-05-23 Thread Bryant G Ly
Quoting "Nicholas A. Bellinger" : So AFAICT for delayed commands, the above patch ends up skipping these three checks subsequently when doing __target_execute_cmd() directly from target_restart_delayed_cmds(), no..? After pondering this some more, what about moving these checks into __target