[PATCH] ch: add refcounting

2017-08-15 Thread Hannes Reinecke
struct scsi_changer needs refcounting as the device might be removed while the fd is still open. Signed-off-by: Hannes Reinecke --- drivers/scsi/ch.c | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c

[PATCH 2/6] qedf: Use granted MAC from the FCF for the FCoE source address if it is available.

2017-08-15 Thread Chad Dupuis
Currently in the driver we've been using the fc_fcoe_set_mac() function to set the source MAC for FCoE traffic. This works well in most cases as it uses the spec. default FCF-MAC. However, if the administrator changes the FCF-MAC switch, then any FCoE traffic we send will be dropped by the

[PATCH 1/6] qedf: Set WWNN and WWPN based on values from qed.

2017-08-15 Thread Chad Dupuis
If dev_info.wwpn and dev_info.wwnn are set by qed use these values to set the WWNs of the port. Otherwise fall back to the old method using fcoe_wwn_from_mac(). Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf_main.c | 21 ++--- 1 file changed, 18

[PATCH 0/6] Update qedf to version 8.20.5.0.

2017-08-15 Thread Chad Dupuis
From: "Chad Dupuis" Hi Martin, Please apply the following patches at your earliest convenience. Thanks, Chad Chad Dupuis (6): qedf: Set WWNN and WWPN based on values from qed. qedf: Use granted MAC from the FCF for the FCoE source address if it is available.

[PATCH 3/6] qedf: Corrent VLAN tag insertion in fallback VLAN case.

2017-08-15 Thread Chad Dupuis
Currently in the driver the qedf_ctx attribute vlan_hw_insert is used to which whether to insert a VLAN tag in FIP frames (except for FIP VLAN request which is explicitly sent out untagged at least from the driver's point of view). When we receive a FIP VLAN response, we set qedf->vlan_hw_insert

[PATCH 4/6] qedf: Covert single-threaded workqueues to regular workqueues.

2017-08-15 Thread Chad Dupuis
There is no ordering required for the various workqueues the driver uses so they can be converted to regular workqueues. Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf_main.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH 5/6] qedf: Fix up modinfo parameter name for 'debug' in modinfo output.

2017-08-15 Thread Chad Dupuis
Because we were passing 'qedf_debug' instead of 'debug' to the MODULE_PARM_DESC() macro, modinfo listed the parameter name as 'qedf_debug' instead of it's proper name 'debug'. Correct the parameter name. Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf_main.c | 2

[PATCH 6/6] qedf: Update driver version to 8.20.5.0.

2017-08-15 Thread Chad Dupuis
Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf_version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qedf/qedf_version.h b/drivers/scsi/qedf/qedf_version.h index 6fa442061c32..397b3b8ee51a 100644 ---

[PATCH] scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()'

2017-08-15 Thread Christophe JAILLET
'rc' is known to be 0 at this point. If 'create_context()' fails, returns -ENOMEM instead of 0 which means success. Signed-off-by: Christophe JAILLET --- drivers/scsi/cxlflash/superpipe.c | 1 + 1 file changed, 1 insertion(+) diff --git

Re: [PATCHv3 2/5] scsi: Export blacklist flags to sysfs

2017-08-15 Thread Bart Van Assche
On Tue, 2017-08-15 at 10:03 +0200, Hannes Reinecke wrote: > On 08/15/2017 05:18 AM, Martin K. Petersen wrote: > > > > Hannes, > > > > > + name = sdev_bflags_name(bflags); > > > + if (name) > > > + blen = snprintf(ptr, strlen(name) + 1, > > > +

Re: 答复: [iscsi] Deadlock occurred when network is in error

2017-08-15 Thread Bart Van Assche
On Tue, 2017-08-15 at 02:16 +, Tangchen (UVP) wrote: > But I'm not using mq, and I run into these two problems in a non-mq system. > The patch you pointed out is fix for mq, so I don't think it can resolve this > problem. > > IIUC, mq is for SSD ? I'm not using ssd, so mq is disabled.

Re: [PATCHv3 1/5] scsi_debug: allow to specify inquiry vendor and model

2017-08-15 Thread Bart Van Assche
On Fri, 2017-08-11 at 16:23 +0200, Hannes Reinecke wrote: > For testing purposes we need to be able to pass in the inquiry > vendor and model. Reviewed-by: Bart Van Assche

Re: [PATCH] scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()'

2017-08-15 Thread Andrew Donnellan
On 16/08/17 06:18, Christophe JAILLET wrote: 'rc' is known to be 0 at this point. If 'create_context()' fails, returns -ENOMEM instead of 0 which means success. Signed-off-by: Christophe JAILLET ENOMEM seems right here. Reviewed-by: Andrew Donnellan

[PATCH] sg: protect against races between mmap() and SG_SET_RESERVED_SIZE

2017-08-15 Thread Todd Poynor
Take f_mutex around mmap() processing to protect against races with the SG_SET_RESERVED_SIZE ioctl. Ensure the reserve buffer length remains consistent during the mapping operation, and set the "mmap called" flag to prevent further changes to the reserved buffer size as an atomic operation with

Re: [PATCHv3 2/5] scsi: Export blacklist flags to sysfs

2017-08-15 Thread Hannes Reinecke
On 08/16/2017 12:47 AM, Bart Van Assche wrote: > On Tue, 2017-08-15 at 10:03 +0200, Hannes Reinecke wrote: >> On 08/15/2017 05:18 AM, Martin K. Petersen wrote: >>> >>> Hannes, >>> + name = sdev_bflags_name(bflags); + if (name) + blen =

Re: [PATCHv3 3/5] scsi_devinfo: Reformat blacklist flags

2017-08-15 Thread Hannes Reinecke
On 08/16/2017 12:52 AM, Bart Van Assche wrote: > On Fri, 2017-08-11 at 16:23 +0200, Hannes Reinecke wrote: >> +typedef __u32 __bitwise sdev_bflags_t; >> + >> +/* Only scan LUN 0 */ >> +#define BLIST_NOLUN ((__force sdev_bflags_t)(1 << 0)) > > Hello Hannes, > > Is the new typedef used

[PATCH] scsi: ncr5380: constify pnp_device_id

2017-08-15 Thread Arvind Yadav
pnp_device_id are not supposed to change at runtime. All functions working with pnp_device_id provided by work with const pnp_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav --- drivers/scsi/g_NCR5380.c | 2 +- 1 file changed, 1

[PATCH] scsi: aha1542: constify pnp_device_id

2017-08-15 Thread Arvind Yadav
pnp_device_id are not supposed to change at runtime. All functions working with pnp_device_id provided by work with const pnp_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav --- drivers/scsi/aha1542.c | 2 +- 1 file changed, 1

Re: [PATCHv3 5/5] scsi_devinfo: fixup string compare

2017-08-15 Thread Hannes Reinecke
On 08/16/2017 01:03 AM, Bart Van Assche wrote: > On Fri, 2017-08-11 at 16:23 +0200, Hannes Reinecke wrote: >> When checking the model and vendor string we need to use the >> minimum value of either string, otherwise we'll miss out on >> wildcard matches. >> And we should take card when matching

[PATCH] sg: recheck MMAP_IO request length with lock held

2017-08-15 Thread Todd Poynor
Commit 1bc0eb044615 ("scsi: sg: protect accesses to 'reserved' page array") adds needed concurrency protection for the "reserve" buffer. Some checks that are initially made outside the lock are replicated once the lock is taken to ensure the checks and resulting decisions are made using consistent

Re: [PATCH] scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()'

2017-08-15 Thread Matthew R. Ochs
> On Aug 15, 2017, at 3:18 PM, Christophe JAILLET > wrote: > > 'rc' is known to be 0 at this point. > If 'create_context()' fails, returns -ENOMEM instead of 0 which means > success. > > Signed-off-by: Christophe JAILLET Yep,

Re: [PATCHv3 2/5] scsi: Export blacklist flags to sysfs

2017-08-15 Thread Martin K. Petersen
Hannes, >> It seems this else statement facilitates papering over the fact that >> scsi_sysfs.c and scsi_devinfo.h can get out of sync. > But there is no good way of avoiding that, is there? > Out of necessity the definition of the bits and the decoding are two > distinct steps, and as such are

RE: 答复: [iscsi] Deadlock occurred when network is in error

2017-08-15 Thread Tangchen (UVP)
> On Tue, 2017-08-15 at 02:16 +, Tangchen (UVP) wrote: > > But I'm not using mq, and I run into these two problems in a non-mq system. > > The patch you pointed out is fix for mq, so I don't think it can resolve > > this > problem. > > > > IIUC, mq is for SSD ? I'm not using ssd, so mq is

Re: [PATCH 2/2] tests/scsi/0001: Regression test for SCSI device blacklisting

2017-08-15 Thread Bart Van Assche
On Wed, 2017-08-09 at 12:50 +0200, Hannes Reinecke wrote: > +requires() { > +if modinfo scsi_debug | grep -q inq_vendor ; then > + return 0 > +fi > +return 1 > +} How about changing the above four statements into the following, which is shorter and more robust? modinfo scsi_debug

Re: [PATCHv3 2/5] scsi: Export blacklist flags to sysfs

2017-08-15 Thread Martin K. Petersen
Hannes, >> Wouldn't debugfs be more appropriate for this attribute than sysfs? >> > I so don't mind. > I just need it somewhere in sysfs/debugfs so that I can validate the > selection logic. > > Same goes for hexvalue vs decoded output; I just need to attribute; > contents can be discussed. I

Re: [PATCH] scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()'

2017-08-15 Thread Martin K. Petersen
Christophe, > 'rc' is known to be 0 at this point. > If 'create_context()' fails, returns -ENOMEM instead of 0 which means > success. Applied to 4.14/scsi-queue. Thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCHv3 5/5] scsi_devinfo: fixup string compare

2017-08-15 Thread Bart Van Assche
On Fri, 2017-08-11 at 16:23 +0200, Hannes Reinecke wrote: > When checking the model and vendor string we need to use the > minimum value of either string, otherwise we'll miss out on > wildcard matches. > And we should take card when matching with zero size strings; "card"? Did you perhaps mean

Re: [PATCHv3 3/5] scsi_devinfo: Reformat blacklist flags

2017-08-15 Thread Bart Van Assche
On Fri, 2017-08-11 at 16:23 +0200, Hannes Reinecke wrote: > +typedef __u32 __bitwise sdev_bflags_t; > + > +/* Only scan LUN 0 */ > +#define BLIST_NOLUN ((__force sdev_bflags_t)(1 << 0)) Hello Hannes, Is the new typedef used anywhere outside the BLIST flag definitions? If not, how about

Re: [PATCH 1/2] tests/scsi: add SCSI midlayer test group

2017-08-15 Thread Omar Sandoval
On Wed, Aug 09, 2017 at 12:50:05PM +0200, Hannes Reinecke wrote: > Add a test group for tests of the SCSI midlayer. > > Signed-off-by: Hannes Reinecke > --- > tests/scsi/group | 26 ++ > 1 file changed, 26 insertions(+) > create mode 100644

Re: [PATCHv3 2/5] scsi: Export blacklist flags to sysfs

2017-08-15 Thread Bart Van Assche
On Fri, 2017-08-11 at 16:23 +0200, Hannes Reinecke wrote: > @@ -1138,6 +1220,7 @@ static umode_t scsi_sdev_bin_attr_is_visible(struct > kobject *kobj, > _attr_queue_depth.attr, > _attr_queue_type.attr, > _attr_wwid.attr, > + _attr_blacklist.attr, > #ifdef CONFIG_SCSI_DH >

Re: [PATCHv3 2/5] scsi: Export blacklist flags to sysfs

2017-08-15 Thread Hannes Reinecke
On 08/15/2017 04:24 PM, Bart Van Assche wrote: > On Fri, 2017-08-11 at 16:23 +0200, Hannes Reinecke wrote: >> @@ -1138,6 +1220,7 @@ static umode_t scsi_sdev_bin_attr_is_visible(struct >> kobject *kobj, >> _attr_queue_depth.attr, >> _attr_queue_type.attr, >> _attr_wwid.attr, >> +

Re: [PATCHv2 0/6] hpsa legacy support

2017-08-15 Thread Hannes Reinecke
On 08/15/2017 05:39 AM, Martin K. Petersen wrote: > > Hannes, > >> here's now the second attempt to add support for legacy boards, ie for >> boards previously supported by cciss only. With this patchset the >> hpsa driver should work with all Smart Array boards if the >> 'hpsa_allow_any' module

[PATCHv3 1/6] hpsa: add support for legacy boards

2017-08-15 Thread Hannes Reinecke
Add support for legacy boards, ensuring to enable the driver for those boards only when 'hpsa_allow_any' is set. The attribute 'legacy_board' is set to '1' if the device is a legacy board, and '0' otherwise. Signed-off-by: Hannes Reinecke Acked-by: Don Brace

[PATCHv3 2/6] hpsa: disable volume status check for legacy boards

2017-08-15 Thread Hannes Reinecke
Legacy boards might not support volume status, so assume the volume is online here. Signed-off-by: Hannes Reinecke Acked-by: Don Brace --- drivers/scsi/hpsa.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/scsi/hpsa.c

[PATCHv3 6/6] hpsa: Remove 'hpsa_allow_any' module option

2017-08-15 Thread Hannes Reinecke
As the cciss driver has been removed there are no overlapping PCI IDs anymore, and the 'hpsa_allow_any' flag can be removed. Signed-off-by: Hannes Reinecke --- drivers/scsi/hpsa.c | 26 +++--- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git

[PATCHv3 0/6] hpsa legacy support

2017-08-15 Thread Hannes Reinecke
Hi all, here's now the third attempt to add support for legacy boards, ie for boards previously supported by cciss only. With this patchset the hpsa driver should work with all Smart Array boards if the 'hpsa_allow_any' module option is set, rendering the cciss driver obsolete. Consequently I've

[PATCHv3 3/6] hpsa: Ignore errors for unsupported LV_DEVICE_ID VPD page

2017-08-15 Thread Hannes Reinecke
Legacy boards might not support the LV_DEVICE_ID VPD page, so we shouldn't print out an error message here. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Acked-by: Don Brace --- drivers/scsi/hpsa.c | 2 +- 1 file changed, 1

[PATCHv3 4/6] hpsa: do not print errors for unsupported report luns format

2017-08-15 Thread Hannes Reinecke
Legacy boards might not support the 'extended' report luns format, but as this is to be expected we don't need to print out an error here. Signed-off-by: Hannes Reinecke Acked-by: Don Brace --- drivers/scsi/hpsa.c | 20 +++- 1 file

Re: [PATCHv3 2/5] scsi: Export blacklist flags to sysfs

2017-08-15 Thread Hannes Reinecke
On 08/15/2017 05:18 AM, Martin K. Petersen wrote: > > Hannes, > >> +name = sdev_bflags_name(bflags); >> +if (name) >> +blen = snprintf(ptr, strlen(name) + 1, >> +"%s", name); >> +else >> +

[PATCH 4/4] ses: make page2 support optional

2017-08-15 Thread Hannes Reinecke
Simple subenclosures do not need to support SES page 2, so make it optional. Signed-off-by: Hannes Reinecke --- drivers/scsi/ses.c | 39 ++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c

[PATCH 2/4] ses: check return code from ses_recv_diag()

2017-08-15 Thread Hannes Reinecke
We should be checking the return code from ses_recv_diag() to avoid accessing invalid data. Signed-off-by: Hannes Reinecke --- drivers/scsi/ses.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c index a37aec8..fc70c00

[PATCH 1/4] scsi: Fixup ses page check

2017-08-15 Thread Hannes Reinecke
The error code from a scsi_execute_req() is a SCSI status, not a normal errno. So whenever it returns a value here an error occurred and there's no point in looking at the page number. Signed-off-by: Hannes Reinecke --- drivers/scsi/ses.c | 4 ++-- 1 file changed, 2

[PATCH 3/4] ses: Fixup error message 'failed to get diagnostic page 0xffffffea'

2017-08-15 Thread Hannes Reinecke
The printk was using the result as argument, leading to a slightly confusing log message. Signed-off-by: Hannes Reinecke --- drivers/scsi/ses.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c index

[PATCH 0/4] ses: simple subenclosure support

2017-08-15 Thread Hannes Reinecke
Hi all, some arrays (most notably 3Par) only support simple subenclosures. Sadly our ses implementation doesn't handle this properly, so we're greeted with error messages like: scsi 1:0:0:254: Wrong diagnostic page; asked for 2 got 0 scsi 1:0:0:254: Failed to get diagnostic page 0xffea scsi

[PATCH] megaraid_sas: Fallback to older scanning if no disks are found

2017-08-15 Thread Hannes Reinecke
commit 21c9e160a51383d4cb0b882398534b0c95c0cc3b implemented a new driver lookup using the MR_DCMD_LD_LIST_QUERY firmware command. However, this command might not work properly on older firmware, causing the command to return no drives instead of an error. This causes a regression on older firmware

[PATCH] megaraid_sas: boot hangs while LD is offline

2017-08-15 Thread Hannes Reinecke
Offline Logical drives (LDs) should not allowed to be visible to the OS, as the OS will hang trying to send commands to it. This patch skips offline LDs like it already does for non-system physical drives (PDs). Signed-off-by: Hannes Reinecke ---

[PATCH] scsi: mpt3sas: fix pr_info message continuation

2017-08-15 Thread Colin King
From: Colin Ian King An optional discovery status should be printed with a pr_cont and needs a leading space to make it more readable. The final new line should also be a pr_cont and the indentation is out by one, so fix that too. Signed-off-by: Colin Ian King

[PATCH] scsi: add missing indent on a for loop statement

2017-08-15 Thread Colin King
From: Colin Ian King The for loop is statement is missing an indent, add it. Signed-off-by: Colin Ian King --- drivers/scsi/osst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c