Re: [PATCH v7 3/5] target: add device vendor_id configfs attribute

2018-12-06 Thread David Disseldorp
On Thu, 6 Dec 2018 15:25:42 +0300, Roman Bolshakov wrote: > > /* > > + * STANDARD and VPD page 0x80 T10 Vendor Identification > > Perhaps you meant 0x83 (Device Identification VPD page, T10 vendor ID > based designator). INQUIRY page 0x80 is Unit Serial Number. Indeed, the comment should

[PATCH v7 3/5] target: add device vendor_id configfs attribute

2018-12-05 Thread David Disseldorp
s set when the backstore device is enabled. Signed-off-by: David Disseldorp --- drivers/target/target_core_configfs.c | 70 +++ 1 file changed, 70 insertions(+) diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index 82

[PATCH v7 5/5] target: perform t10_wwn ID initialisation in target_alloc_device()

2018-12-05 Thread David Disseldorp
of ConfigFS. Signed-off-by: David Disseldorp Reviewed-by: Roman Bolshakov --- drivers/target/target_core_device.c | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index ebd787bb29a8

[PATCH v7 2/5] target: consistently null-terminate t10_wwn strings

2018-12-05 Thread David Disseldorp
instead. Signed-off-by: David Disseldorp --- drivers/target/target_core_configfs.c | 16 +++ drivers/target/target_core_device.c | 46 ++-- drivers/target/target_core_pscsi.c| 50 +++ drivers/target/target_core_spc.c

[PATCH v7 1/5] target: use consistent left-aligned ASCII INQUIRY data

2018-12-05 Thread David Disseldorp
in the standard INQUIRY data as well as the T10 VENDOR IDENTIFICATION field in the INQUIRY Device Identification VPD Page are zero-terminated/zero-padded. Fix this inconsistency by using space-padding for all of the above fields. Signed-off-by: David Disseldorp Reviewed-by: Christoph Hellwig

[PATCH v7 0/5] target: user configurable T10 Vendor ID

2018-12-05 Thread David Disseldorp
istent INQUIRY data padding as a separate patch - Drop t10_wwn.model buffer print fix, already upstream Changes since v1: - https://www.spinics.net/lists/target-devel/msg10545.html - Rebase against nab's for-next branch, which includes Christoph's configfs API changes. David Disseldorp (5):

Re: [PATCH v6 3/5] target: add device vendor_id configfs attribute

2018-12-04 Thread David Disseldorp
On Tue, 4 Dec 2018 15:13:51 +0300, Roman Bolshakov wrote: > > + /* Assume ASCII encoding. Strip any newline added from userspace. */ > > + BUILD_BUG_ON(sizeof(dev->t10_wwn.vendor) != INQUIRY_VENDOR_LEN + 1); > > + strlcpy(dev->t10_wwn.vendor, strstrip(buf), > > +

Re: [PATCH v6 3/5] target: add device vendor_id configfs attribute

2018-12-04 Thread David Disseldorp
On Tue, 4 Dec 2018 16:26:59 +0300, Roman Bolshakov wrote: > wrt PATCH 5 in the series. Should we allow to set vendor_id for for > pscsi? target_transport_configure sets t10_wwn fields for pscsi, but but > an attempt to set vendor_id will overwrite the value recieved from > scsi_device. I

[PATCH v6 2/5] target: consistently null-terminate t10_wwn strings

2018-12-04 Thread David Disseldorp
instead. Signed-off-by: David Disseldorp Reviewed-by: Hannes Reinecke --- drivers/target/target_core_configfs.c | 14 +++--- drivers/target/target_core_device.c | 49 --- drivers/target/target_core_pscsi.c| 18 - drivers/target

[PATCH v6 3/5] target: add device vendor_id configfs attribute

2018-12-04 Thread David Disseldorp
s set when the backstore device is enabled. Signed-off-by: David Disseldorp Reviewed-by: Bryant G. Ly Reviewed-by: Lee Duncan Reviewed-by: Hannes Reinecke --- drivers/target/target_core_configfs.c | 48 +++ 1 file changed, 48 insertions(+) diff --git a/driv

[PATCH v6 1/5] target: use consistent left-aligned ASCII INQUIRY data

2018-12-04 Thread David Disseldorp
in the standard INQUIRY data as well as the T10 VENDOR IDENTIFICATION field in the INQUIRY Device Identification VPD Page are zero-terminated/zero-padded. Fix this inconsistency by using space-padding for all of the above fields. Signed-off-by: David Disseldorp Reviewed-by: Christoph Hellwig

[PATCH v6 4/5] target: remove hardcoded T10 Vendor ID in INQUIRY response

2018-12-04 Thread David Disseldorp
Use the value stored in t10_wwn.vendor, which defaults to "LIO-ORG", but can be reconfigured via the vendor_id ConfigFS attribute. Signed-off-by: David Disseldorp Reviewed-by: Bryant G. Ly Reviewed-by: Lee Duncan Reviewed-by: Hannes Reinecke --- drivers/target/target_core

[PATCH v6 5/5] target: perform t10_wwn ID initialisation in target_alloc_device()

2018-12-04 Thread David Disseldorp
for anything outside of ConfigFS. Signed-off-by: David Disseldorp --- drivers/target/target_core_device.c | 27 ++- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 5512871f50e4

[PATCH v6 0/5] target: user configurable T10 Vendor ID

2018-12-04 Thread David Disseldorp
This patch-set allows for the modification of the T10 Vendor Identification string returned in the SCSI INQUIRY response, via the target/core/$backstore/$name/wwn/vendor_id ConfigFS path. Changes since v5: - remove unnecessary TRANSPORT_FLAG_PASSTHROUGH conditional from t10_wwn ID defaults

Re: [PATCH v5 5/5] target: perform t10_wwn ID initialisation in target_alloc_device()

2018-12-03 Thread David Disseldorp
On Sun, 2 Dec 2018 23:22:23 +0100, David Disseldorp wrote: > > > + if (!(dev->transport->transport_flags & TRANSPORT_FLAG_PASSTHROUGH)) { > > > + strlcpy(dev->t10_wwn.vendor, "LIO-ORG", > > > + sizeof(dev->t10_wwn.vend

Re: [PATCH v5 5/5] target: perform t10_wwn ID initialisation in target_alloc_device()

2018-12-02 Thread David Disseldorp
Hi Hannes, Thanks for the feedback... On Sat, 1 Dec 2018 15:59:25 +0100, Hannes Reinecke wrote: > On 12/1/18 12:34 AM, David Disseldorp wrote: ... > > @@ -810,6 +810,23 @@ struct se_device *target_alloc_device(struct se_hba > > *hba, const char *name) > >

[PATCH v5 5/5] target: perform t10_wwn ID initialisation in target_alloc_device()

2018-11-30 Thread David Disseldorp
Initialise the t10_wwn vendor, model and revision defaults when a device is allocated instead of when it's enabled. This ensures that custom vendor or model strings set prior to enablement are not later overwritten with default values. Signed-off-by: David Disseldorp --- drivers/target

[PATCH v5 2/5] target: consistently null-terminate t10_wwn strings

2018-11-30 Thread David Disseldorp
instead. Signed-off-by: David Disseldorp --- drivers/target/target_core_configfs.c | 14 +++--- drivers/target/target_core_device.c | 49 --- drivers/target/target_core_pscsi.c| 18 - drivers/target/target_core_spc.c | 7 ++--- drivers

[PATCH v5 3/5] target: add device vendor_id configfs attribute

2018-11-30 Thread David Disseldorp
s set when the backstore device is enabled. Signed-off-by: David Disseldorp Reviewed-by: Bryant G. Ly Reviewed-by: Lee Duncan --- drivers/target/target_core_configfs.c | 48 +++ 1 file changed, 48 insertions(+) diff --git a/drivers/target/target_core_configfs.c b/driv

[PATCH v5 4/5] target: remove hardcoded T10 Vendor ID in INQUIRY response

2018-11-30 Thread David Disseldorp
Use the value stored in t10_wwn.vendor, which defaults to "LIO-ORG", but can be reconfigured via the vendor_id ConfigFS attribute. Signed-off-by: David Disseldorp Reviewed-by: Bryant G. Ly Reviewed-by: Lee Duncan --- drivers/target/target_core_spc.c | 8 +--- 1 file changed, 5

[PATCH v5 0/5] target: user configurable T10 Vendor ID

2018-11-30 Thread David Disseldorp
changes. David Disseldorp (5): target: use consistent left-aligned ASCII INQUIRY data target: consistently null-terminate t10_wwn strings target: add device vendor_id configfs attribute target: remove hardcoded T10 Vendor ID in INQUIRY response target: perform t10_wwn

[PATCH v5 1/5] target: use consistent left-aligned ASCII INQUIRY data

2018-11-30 Thread David Disseldorp
in the standard INQUIRY data as well as the T10 VENDOR IDENTIFICATION field in the INQUIRY Device Identification VPD Page are zero-terminated/zero-padded. Fix this inconsistency by using space-padding for all of the above fields. Signed-off-by: David Disseldorp Reviewed-by: Christoph Hellwig

Re: [PATCH v4 6/7] target: remove hardcoded T10 Vendor ID in INQUIRY response

2018-11-30 Thread David Disseldorp
On Fri, 30 Nov 2018 14:17:49 +0100, David Disseldorp wrote: > > Where is the code that initializes dev->t10_wwn.vendor to "LIO-ORG"? Did I > > perhaps overlook something? > > This is done in target_configure_device() . Hmm, continuing to do it there may cause

Re: [PATCH v4 6/7] target: remove hardcoded T10 Vendor ID in INQUIRY response

2018-11-30 Thread David Disseldorp
On Thu, 29 Nov 2018 08:35:26 -0800, Bart Van Assche wrote: > Where is the code that initializes dev->t10_wwn.vendor to "LIO-ORG"? Did I > perhaps overlook something? This is done in target_configure_device() . > Additionally, why are you using strnlen() for > a string of which it is guaranteed

Re: [PATCH v4 5/7] target: add device vendor_id configfs attribute

2018-11-29 Thread David Disseldorp
On Thu, 29 Nov 2018 08:32:47 -0800, Bart Van Assche wrote: > > + unsigned char buf[INQUIRY_VENDOR_LEN + 1]; > > + > > + if (strlen(page) > INQUIRY_VENDOR_LEN) { > > + pr_err("Emulated T10 Vendor Identification exceeds" > > + " INQUIRY_VENDOR_LEN: "

Re: [PATCH v4 3/7] target: consistently null-terminate t10_wwn.model

2018-11-29 Thread David Disseldorp
On Thu, 29 Nov 2018 08:24:38 -0800, Bart Van Assche wrote: > On Thu, 2018-11-29 at 02:01 +0100, David Disseldorp wrote: > > diff --git a/drivers/target/target_core_configfs.c > > b/drivers/target/target_core_configfs.c > > index f6b1549f4142..9f49b1afd685 100644 >

[PATCH v4 3/7] target: consistently null-terminate t10_wwn.model

2018-11-28 Thread David Disseldorp
to avoid changing the model string for existing deployments. Signed-off-by: David Disseldorp --- drivers/target/target_core_configfs.c | 8 +--- drivers/target/target_core_device.c | 8 +--- drivers/target/target_core_pscsi.c| 6 -- drivers/target/target_core_spc.c | 2

[PATCH v4 7/7] target: use printf width specifier for t10_wwn field dumps

2018-11-28 Thread David Disseldorp
From: Bart Van Assche The existing for loops step over null-terminators for right-padding. Padding can be achieved in a much simpler way using printf width specifiers. Signed-off-by: David Disseldorp --- drivers/target/target_core_device.c | 35 --- drivers

[PATCH v4 6/7] target: remove hardcoded T10 Vendor ID in INQUIRY response

2018-11-28 Thread David Disseldorp
Use the value stored in t10_wwn.vendor, which defaults to "LIO-ORG", but can be reconfigured via the vendor_id ConfigFS attribute. Signed-off-by: David Disseldorp --- drivers/target/target_core_spc.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/driv

[PATCH v4 4/7] target: consistently null-terminate t10_wwn.revision

2018-11-28 Thread David Disseldorp
The pscsi_set_inquiry_info() codepath doesn't currently explicitly null-terminate t10_wwn.revision. Add an extra byte to the t10_wwn.model buffer and perform null string termination in all cases. Signed-off-by: David Disseldorp --- drivers/target/target_core_device.c | 6 -- drivers/target

[PATCH v4 5/7] target: add device vendor_id configfs attribute

2018-11-28 Thread David Disseldorp
s set when the backstore device is enabled. Signed-off-by: David Disseldorp --- drivers/target/target_core_configfs.c | 48 +++ 1 file changed, 48 insertions(+) diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index 9f

[PATCH v4 2/7] target: consistently null-terminate t10_wwn.vendor

2018-11-28 Thread David Disseldorp
In preparation for supporting user provided vendor strings, add an extra byte to t10_wwn.vendor which will ensure null string termination when an eight byte vendor string is provided by the user. Signed-off-by: David Disseldorp --- drivers/target/target_core_device.c | 6 -- drivers/target

[PATCH v4 0/7] target: user configurable T10 Vendor ID

2018-11-28 Thread David Disseldorp
://www.spinics.net/lists/target-devel/msg10545.html - Rebase against nab's for-next branch, which includes Christoph's configfs API changes. Bart Van Assche (1): target: use printf width specifier for t10_wwn field dumps David Disseldorp (6): target: use consistent left-aligned ASCII INQUIRY data

[PATCH v4 1/7] target: use consistent left-aligned ASCII INQUIRY data

2018-11-28 Thread David Disseldorp
in the standard INQUIRY data as well as the T10 VENDOR IDENTIFICATION field in the INQUIRY Device Identification VPD Page are zero-terminated/zero-padded. Fix this inconsistency by using space-padding for all of the above fields. Signed-off-by: David Disseldorp Reviewed-by: Christoph Hellwig

Re: [PATCH v3 3/4] target: add device vendor_id configfs attribute

2018-11-28 Thread David Disseldorp
Hi Bart, On Wed, 28 Nov 2018 08:36:19 -0800, Bart Van Assche wrote: > Maybe I'm missing something, but why is zeroing of unused bytes in these > functions > necessary? Would the following be correct if all strings in struct t10_wwn > would be > '\0'-terminated? Your patch looks good to me.

Re: [PATCH v3 3/4] target: add device vendor_id configfs attribute

2018-11-28 Thread David Disseldorp
On Wed, 28 Nov 2018 08:08:30 -0800, Bart Van Assche wrote: > > Just a follow up here. I think it's safer to retain strncpy() in this > > function for the purpose of zero filling. scsi_dump_inquiry() and > > target_stat_lu_vend_show() walk the entire length of the t10_wwn.vendor > > buffer. > >

Re: [PATCH v3 3/4] target: add device vendor_id configfs attribute

2018-11-28 Thread David Disseldorp
On Tue, 20 Nov 2018 19:00:57 +0100, David Disseldorp wrote: > > > + strncpy(buf, page, sizeof(buf)); > > > > Isn't strncpy() deprecated? How about using strlcpy() instead? > > Will change to use strlcpy in the next round. Just a follow up here. I think i

Re: [PATCH] target: drop unnecessary get_fabric_name() accessor from fabric_ops

2018-11-23 Thread David Disseldorp
On Fri, 23 Nov 2018 11:22:08 +0100, David Disseldorp wrote: > > > Both fabric_ops.get_fabric_name() and fabric_ops.name are user facing, > > > with the former being used for PR/ALUA state and the latter for configFS > > > (config/target/$name), so we unfortunatel

[PATCH 2/3] target: drop unnecessary get_fabric_name() accessor from fabric_ops

2018-11-23 Thread David Disseldorp
unfortunately need to keep both strings around for now. Replace the useless .get_fabric_name() accessor function with a const string fabric_name member variable. Signed-off-by: David Disseldorp --- drivers/infiniband/ulp/srpt/ib_srpt.c| 7 +-- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 7

[PATCH 0/3] target: drop unneeded pi_prot_format and get_fabric_name()

2018-11-23 Thread David Disseldorp
() - use a new fabric_ops.fabric_alias member to handle the iscsi_target_mod special case. Cheers, David David Disseldorp (3): target: drop unused pi_prot_format attribute storage target: drop unnecessary get_fabric_name() accessor from fabric_ops target: replace fabric_ops.name

[PATCH 3/3] target: replace fabric_ops.name with fabric_alias

2018-11-23 Thread David Disseldorp
initialised. iscsi_target_mod is the only fabric module to set .fabric_alias . All other fabric modules rely on .fabric_name matching and can drop the duplicate string. Signed-off-by: David Disseldorp --- drivers/infiniband/ulp/srpt/ib_srpt.c| 1 - drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c

[PATCH 1/3] target: drop unused pi_prot_format attribute storage

2018-11-23 Thread David Disseldorp
-by: David Disseldorp --- drivers/target/target_core_configfs.c | 3 +-- include/target/target_core_base.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index 70b9f6755c36..62427acdf503 100644

Re: [PATCH] target: drop unnecessary get_fabric_name() accessor from fabric_ops

2018-11-23 Thread David Disseldorp
On Thu, 22 Nov 2018 23:19:10 -0800, Christoph Hellwig wrote: > On Thu, Nov 22, 2018 at 03:16:23PM +0100, David Disseldorp wrote: > > All fabrics return a const string. In all cases *except* iSCSI the > > get_fabric_name() string matches fabric_ops.name. > > > > Both

[PATCH] target: drop unnecessary get_fabric_name() accessor from fabric_ops

2018-11-22 Thread David Disseldorp
unfortunately need to keep both strings around for now. Replace the useless .get_fabric_name() accessor function with a const string fabric_name member variable. Signed-off-by: David Disseldorp --- Note: This conflicts with: [RFC PATCH] target: sanitize ALUA and PR state file paths before use I'll

[RFC PATCH] target: sanitize ALUA and PR state file paths before use

2018-11-22 Thread David Disseldorp
Block ALUA and PR state storage if any of the dynamic subdirectory components include a path separator. Fixes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6") Signed-off-by: David Disseldorp Signed-off-by: Lee Duncan --- Note: Submitted as an RFC, as I've not prope

Re: [PATCH v3 3/4] target: add device vendor_id configfs attribute

2018-11-20 Thread David Disseldorp
On Tue, 20 Nov 2018 09:24:39 -0800, Bart Van Assche wrote: > On Mon, 2018-11-19 at 22:06 +0100, David Disseldorp wrote: > > /* > > + * STANDARD and VPD page 0x80 T10 Vendor Identification > > + */ > > +static ssize_t target_wwn_vendor_id_show(struct config_item *item,

Re: [PATCH v3 2/4] target: don't assume t10_wwn.vendor is null terminated

2018-11-20 Thread David Disseldorp
On Tue, 20 Nov 2018 08:49:24 -0800, Christoph Hellwig wrote: > This could use a little more explanation, the code doesn't just > add a little if but also changes the existing case. Also where > can't it be null currently? I'll add an explanation in the next round. This patch shouldn't cause any

[PATCH v3 1/4] target: use consistent left-aligned ASCII INQUIRY data

2018-11-19 Thread David Disseldorp
in the standard INQUIRY data as well as the T10 VENDOR IDENTIFICATION field in the INQUIRY Device Identification VPD Page are zero-terminated/zero-padded. Fix this inconsistency by using space-padding for all of the above fields. Signed-off-by: David Disseldorp --- drivers/target/target_core_spc.c

[PATCH v3 2/4] target: don't assume t10_wwn.vendor is null terminated

2018-11-19 Thread David Disseldorp
Signed-off-by: David Disseldorp --- drivers/target/target_core_stat.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/target/target_core_stat.c b/drivers/target/target_core_stat.c index f0db91ebd735..89f35167f036 100644 --- a/drivers/target

[PATCH v3 4/4] target: remove hardcoded T10 Vendor ID in INQUIRY response

2018-11-19 Thread David Disseldorp
Use the value stored in t10_wwn.vendor, which defaults to "LIO-ORG", but can be reconfigured via the vendor_id ConfigFS attribute. Signed-off-by: David Disseldorp --- drivers/target/target_core_spc.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/driv

[PATCH v3 0/4] target: user configurable T10 Vendor ID

2018-11-19 Thread David Disseldorp
. David Disseldorp (4): target: use consistent left-aligned ASCII INQUIRY data target: don't assume t10_wwn.vendor is null terminated target: add device vendor_id configfs attribute target: remove hardcoded T10 Vendor ID in INQUIRY response drivers/target/target_core_configfs.c

[PATCH v3 3/4] target: add device vendor_id configfs attribute

2018-11-19 Thread David Disseldorp
s set when the backstore device is enabled. Signed-off-by: David Disseldorp --- drivers/target/target_core_configfs.c | 55 +++ include/target/target_core_base.h | 3 +- 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/drivers/target/target_core_con

Re: [PATCH v5] target: add emulate_pr backstore attr to toggle PR support

2018-11-19 Thread David Disseldorp
Ping, did anyone get a chance to look at this one? Cheers, David

Re: [RFC PATCH 0/3] target: remove some unused stats

2018-11-16 Thread David Disseldorp
Hi Mike On Tue, 30 Oct 2018 10:54:07 -0500, Mike Christie wrote: > >> This patchset removes a couple of unused error stat counters and a > >> redundant cumulative counter. > >> I've tagged this patchset RFC, as it may be considered a kernel<->user > >> (configfs) API change. > > > > Ping, any

[PATCH v5] target: add emulate_pr backstore attr to toggle PR support

2018-11-07 Thread David Disseldorp
ends to block such requests, avoiding the multi-node reservation state propagation. When explicitly disabled, PR and RESERVE/RELEASE requests receive Invalid Command Operation Code response sense data. Signed-off-by: David Disseldorp --- drivers/target/target_core_configfs.c

Re: [PATCH v4] target: add emulate_pr backstore attr to toggle PR support

2018-11-07 Thread David Disseldorp
On Tue, 6 Nov 2018 19:54:17 -0600, Mike Christie wrote: > > - return snprintf(page, PAGE_SIZE, "%d\n", > > - flags & TRANSPORT_FLAG_PASSTHROUGH_PGR ? 0 : 1); > > + if (!da->da_dev->dev_attrib.emulate_pr || > > + (flags & TRANSPORT_FLAG_PASSTHROUGH_PGR)) > > +

[PATCH v4] target: add emulate_pr backstore attr to toggle PR support

2018-10-30 Thread David Disseldorp
ends to block such requests, avoiding the need for multi-node reservation state propagation. When explicitly disabled, PR and RESERVE/RELEASE requests receive Invalid Command Operation Code response sense data. Signed-off-by: David Disseldorp --- drivers/target/target_core_configfs.c

Re: [RFC PATCH 0/3] target: remove some unused stats

2018-10-29 Thread David Disseldorp
On Wed, 17 Oct 2018 17:48:17 +0200, David Disseldorp wrote: > This patchset removes a couple of unused error stat counters and a > redundant cumulative counter. > I've tagged this patchset RFC, as it may be considered a kernel<->user > (configfs) API change. Ping, any thought

[RFC PATCH 2/3] target: remove unused session PDU-format-errors metric

2018-10-17 Thread David Disseldorp
Signed-off-by: David Disseldorp --- drivers/target/iscsi/iscsi_target_stat.c | 14 +- include/target/iscsi/iscsi_target_stat.h | 2 -- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_stat.c b/drivers/target/iscsi/iscsi_target_stat.c

[RFC PATCH 3/3] target: remove cumulative session errors metric

2018-10-17 Thread David Disseldorp
The cumulative session errors metric matches cxn_timeout_errors, so drop the duplicate. Signed-off-by: David Disseldorp --- drivers/target/iscsi/iscsi_target_stat.c | 16 1 file changed, 16 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_stat.c b/drivers/target

[RFC PATCH 1/3] target: remove unused session digest-errors metric

2018-10-17 Thread David Disseldorp
Signed-off-by: David Disseldorp --- drivers/target/iscsi/iscsi_target_stat.c | 14 +- include/target/iscsi/iscsi_target_stat.h | 2 -- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_stat.c b/drivers/target/iscsi/iscsi_target_stat.c

[RFC PATCH 0/3] target: remove some unused stats

2018-10-17 Thread David Disseldorp
This patchset removes a couple of unused error stat counters and a redundant cumulative counter. I've tagged this patchset RFC, as it may be considered a kernel<->user (configfs) API change. Cheers, David --- drivers/target/iscsi/iscsi_target_stat.c | 40

Re: [PATCH v3 4/5] target: split out helper for cxn timeout error stashing

2018-10-16 Thread David Disseldorp
On Tue, 16 Oct 2018 00:42:57 -0400, Martin K. Petersen wrote: > > I guess I'll resend entire series in future to avoid false kbuild > > reports. > > Yes, please. Patchwork can't handle individual patches getting updated > either. Okay, will do. > Applied to 4.20/scsi-queue. Thanks Martin.

Re: [PATCH v3 4/5] target: split out helper for cxn timeout error stashing

2018-10-14 Thread David Disseldorp
On Sun, 14 Oct 2018 11:43:34 +0800, kbuild test robot wrote: > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on target/master] > [also build test ERROR on v4.19-rc7 next-20181012] > [if your patch is applied to the wrong git tree, please drop us a note to > help

[PATCH v3] target: split out helper for cxn timeout error stashing

2018-10-13 Thread David Disseldorp
Replace existing nested code blocks with helper function calls. Signed-off-by: David Disseldorp --- drivers/target/iscsi/iscsi_target_erl0.c | 15 + drivers/target/iscsi/iscsi_target_util.c | 36 ++-- drivers/target/iscsi/iscsi_target_util.h | 1 + 3

Re: [PATCH v2 4/5] target: split out helper for cxn timeout error stashing

2018-10-13 Thread David Disseldorp
On Fri, 12 Oct 2018 09:11:27 -0700, Bart Van Assche wrote: > There have been too many problems with strcpy() and buffer overflows in the > past. If the source and destination strings both have the same size, please > add a BUILD_BUG_ON() statement that verifies that at compile time. If that >

[PATCH v2 0/5] target: improve Data-Out and NOP timeout error reporting

2018-10-12 Thread David Disseldorp
The following patchset converts existing Data-Out and NOP ping timeout messages from pr_debug() to pr_error(), to reflect the seriousness of unexpected connection termination events. These events can be triggered using a couple of libiscsi client hacks:

[PATCH v2 5/5] target: stash sess_err_stats on Data-Out timeout

2018-10-12 Thread David Disseldorp
sess_err_stats are currently filled on NOP ping timeout, but not Data-Out timeout. Stash details of Data-Out timeouts using a ISCSI_SESS_ERR_CXN_TIMEOUT value for last_sess_failure_type. Signed-off-by: David Disseldorp --- drivers/target/iscsi/iscsi_target_erl1.c | 1 + 1 file changed, 1

[PATCH v2 2/5] target: log Data-Out timeouts as errors

2018-10-12 Thread David Disseldorp
Data-Out timeouts resulting in connection outages should be logged as errors. Include the I_T Nexus in the message to aid path identification. Signed-off-by: David Disseldorp --- drivers/target/iscsi/iscsi_target_erl1.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions

[PATCH v2 4/5] target: split out helper for cxn timeout error stashing

2018-10-12 Thread David Disseldorp
Replace existing nested code blocks with helper function calls. Signed-off-by: David Disseldorp --- drivers/target/iscsi/iscsi_target_erl0.c | 15 +- drivers/target/iscsi/iscsi_target_util.c | 35 +--- drivers/target/iscsi/iscsi_target_util.h | 1 + 3

[PATCH v2 3/5] target: log NOP ping timeouts as errors

2018-10-12 Thread David Disseldorp
Events resulting in connection outages like this should be logged as errors. Include the I_T Nexus in the message to aid path identification. Signed-off-by: David Disseldorp --- drivers/target/iscsi/iscsi_target_util.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git

[PATCH v2 1/5] target: use ISCSI_IQN_LEN in iscsi_target_stat

2018-10-12 Thread David Disseldorp
Move the ISCSI_IQN_LEN definition up, so that it can be used in more places instead of a hardcoded value. Signed-off-by: David Disseldorp --- drivers/target/iscsi/iscsi_target_stat.c | 4 ++-- include/target/iscsi/iscsi_target_core.h | 6 +++--- include/target/iscsi/iscsi_target_stat.h | 4

[PATCH v3] target: fix truncated PR-in ReadKeys response

2018-06-19 Thread David Disseldorp
quot; test in the Windows 2016 Server Failover Cluster validation suites when having many connections that result in more than 8 registrations. I tested your patch on 4.17 with iblock. This behaviour can be tested using the libiscsi PrinReadKeys.Truncate test. Cc: sta...@vger.kernel.org Signed-off

Re: [PATCH v2] target: fix truncated PR-in ReadKeys response

2018-06-19 Thread David Disseldorp
cc'ing the SCSI list, as it doesn't look like anything is making it through target-devel nowadays... https://patchwork.kernel.org/patch/10448059/ Cheers, David On Tue, 5 Jun 2018 12:00:25 +0200, David Disseldorp wrote: > SPC5r17 states that the contents of the ADDITIONAL LENGTH fi

Re: [PATCH 01/33] TCMU PR: first commit to implement TCMU PR

2018-06-18 Thread David Disseldorp
On Mon, 18 Jun 2018 04:12:17 -0700, Christoph Hellwig wrote: > On Sun, Jun 17, 2018 at 12:40:56PM +0800, Zhu Lingshan wrote: > > Hello Mike and Christoph, > > Thanks Mike's comment inspired me, if I understand this correctly, it is > > suggested to implement this whole solution in kernel, avoid >

Re: [PATCH 1/1] target:separate tx/rx cmd_puds

2018-04-06 Thread David Disseldorp
On Thu, 5 Apr 2018 13:12:12 +0200, David Disseldorp wrote: > > -CONFIGFS_ATTR_RO(target_stat_tgt_port_, in_cmds); > > +CONFIGFS_ATTR_RO(target_stat_tgt_port_, tx_cmds); > > +CONFIGFS_ATTR_RO(target_stat_tgt_port_, rx_cmds); > > I don't think the in_cmds metric should b

Re: [PATCH 1/1] target:separate tx/rx cmd_puds

2018-04-05 Thread David Disseldorp
Hi, The commit summary has a typo (cmd_puds). That said, this change isn't iSCSI specific, so using "pdu" here doesn't make much sense IMO. On Wed, 21 Mar 2018 17:52:43 +0800, Zhang Zhuoyu wrote: > Separate tx/rx cmd_pdus in order to distinguish LUN read/write IOPS. > > Signed-off-by: Zhang

Re: Persistent Reservation API

2015-08-11 Thread David Disseldorp
Hi Christoph, On Tue, 4 Aug 2015 09:11:05 +0200, Christoph Hellwig wrote: This series adds support for a simplified persistent reservation API to the block layer. The intent is that both in-kernel and userspace consumers can use the API instead of having to hand craft SCSI or NVMe command

Re: Persistent Reservation API

2015-08-11 Thread David Disseldorp
On Tue, 11 Aug 2015 14:26:34 +0200, Christoph Hellwig wrote: if you want to add SCSI-2 RESERVE/RELEASE it would be at least different opcodes if not an entirely different API. But what for? RESERVE/RELEASE are basially unsuable and that's why there are almost no users out there, and they can