Re: [PATCH 19/24] scsi_ioctl: return error code when blk_map_user() fails

2019-10-21 Thread Hannes Reinecke
On 10/21/19 6:44 PM, Bart Van Assche wrote: > On 10/21/19 2:53 AM, Hannes Reinecke wrote: >> When failing to map the user buffer we should return the actual >> error code, avoiding the usage of DRIVER_ERROR. >> >> Signed-off-by: Hannes Reinecke >> --- >>

Re: [PATCH 18/24] st: return error code in st_scsi_execute()

2019-10-21 Thread Hannes Reinecke
On 10/21/19 6:41 PM, Bart Van Assche wrote: > On 10/21/19 2:53 AM, Hannes Reinecke wrote: >> We should return the actual error code in st_scsi_execute(), >> avoiding the need to use DRIVER_ERROR. >> >> Signed-off-by: Hannes Reinecke >> --- >>   drivers/sc

Re: [PATCH 11/24] advansys: kill driver_defined status byte accessors

2019-10-21 Thread Hannes Reinecke
On 10/21/19 6:37 PM, Bart Van Assche wrote: > On 10/21/19 2:53 AM, Hannes Reinecke wrote: >> @@ -6021,43 +6015,28 @@ static void adv_isr_callback(ADV_DVC_VAR >> *adv_dvc_varp, ADV_SCSI_REQ_Q *scsiqp) >>   ASC_DBG(2, "

Re: [PATCH RFC 00/24] scsi: Revamp result values

2019-10-21 Thread Hannes Reinecke
On 10/21/19 8:32 PM, Douglas Gilbert wrote: > On 2019-10-21 5:52 a.m., Hannes Reinecke wrote: >> Hi all, >> >> the 'result' field in the SCSI command is defined as having >> 4 fields. The top byte is declared as a 'driver_byte', where the >&g

Re: [PATCH 13/24] scsi: Kill DRIVER_SENSE

2019-10-21 Thread Hannes Reinecke
that a REQUEST SENSE command can never result in SAM_STAT_GOOD, > right? Are there implications for higher layers? > Hmm. Blasted REQUEST SENSE. Indeed a REQUEST SENSE command should never return with CHECK_CONDITION. But then a REQUEST SENSE command returns with the sense code

Re: [PATCH 12/24] scsi: introduce scsi_build_sense()

2019-10-21 Thread Hannes Reinecke
On 10/22/19 1:31 AM, Finn Thain wrote: > > On Mon, 21 Oct 2019, Hannes Reinecke wrote: > >> Introduce scsi_build_sense() as a wrapper around >> scsi_build_sense_buffer() to format the buffer and set >> the correct SCSI status. >> >> Signed-off-by: Hannes

Re: [PATCH 05/24] scsi: use standard SAM status codes

2019-10-21 Thread Hannes Reinecke
On 10/22/19 1:17 AM, Finn Thain wrote: > On Mon, 21 Oct 2019, Hannes Reinecke wrote: > >> Use standard SAM status codes and omit the explicit shift to convert >> to linus-specific ones. > > "Linux-specific". > Indeed, it was Linus who did that :-) Will be

Re: [PATCH 03/24] wd33c93: use SCSI status

2019-10-21 Thread Hannes Reinecke
On 10/22/19 1:16 AM, Finn Thain wrote: > On Mon, 21 Oct 2019, Hannes Reinecke wrote: > >> Use standard SCSI status and drop usage of the linux-specific ones. >> >> Signed-off-by: Hannes Reinecke >> --- >> drivers/scsi/wd33c93.c | 21 - >

Re: [PATCH 10/24] scsi: introduce set_status_byte()

2019-10-21 Thread Hannes Reinecke
On 10/22/19 12:12 AM, Finn Thain wrote: > On Mon, 21 Oct 2019, Hannes Reinecke wrote: > >> To be in-line with the other set_XX_byte() functions. >> >> Signed-off-by: Hannes Reinecke >> --- >> include/scsi/scsi_cmnd.h | 5 + >> 1 file changed, 5 ins

Re: [PATCH v5 05/23] sg: bitops in sg_device

2019-10-21 Thread Hannes Reinecke
On 10/21/19 3:22 PM, Douglas Gilbert wrote: > On 2019-10-18 6:05 a.m., Hannes Reinecke wrote: [ .. ] >> One thing to keep in mind here is that 'set_bit()' is not atomic; it >> needs to be followed by a memory barrier or being replaced by >> test_and_set_bit() if pos

Re: [PATCH v5 00/13] scsi: core: fix uninit-value access of variable sshdr

2019-10-21 Thread Hannes Reinecke
ve several code paths where sense evaluation is >> contingent on DRIVER_SENSE. So no matter what, behavior might >> change if we enforce consistent semantics. *sigh* > > So what should we do to prevent unit-value access of sshdr? > Where do you see it? >From my

[PATCH 20/24] scsi_dh_alua: do not interpret DRIVER_ERROR

2019-10-21 Thread Hannes Reinecke
Remove the special handling for DRIVER_ERROR; if there is an error we should just fail the command and don't try anything clever. Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/scsi/device_ha

[PATCH 10/24] scsi: introduce set_status_byte()

2019-10-21 Thread Hannes Reinecke
To be in-line with the other set_XX_byte() functions. Signed-off-by: Hannes Reinecke --- include/scsi/scsi_cmnd.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 91bd749a02f7..6932d91472d5 100644 --- a/include/scsi/scsi_cmnd.h

[PATCH 19/24] scsi_ioctl: return error code when blk_map_user() fails

2019-10-21 Thread Hannes Reinecke
When failing to map the user buffer we should return the actual error code, avoiding the usage of DRIVER_ERROR. Signed-off-by: Hannes Reinecke --- block/scsi_ioctl.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index

[PATCH 06/24] scsi: change status_byte() to return the standard SCSI status

2019-10-21 Thread Hannes Reinecke
Instead of returning the linux-special status (which is shifted by 1 to the right) change the status_byte() macro to return the correct SCSI standard status. And audit all callers to handle this change. Signed-off-by: Hannes Reinecke --- drivers/scsi/53c700.c| 6 +++--- drivers/scsi

[PATCH 24/24] scsi: Drop now obsolete driver_byte definitions

2019-10-21 Thread Hannes Reinecke
The driver_byte field in the result is now unused, so we can drop the definitions. Signed-off-by: Hannes Reinecke --- Documentation/scsi/scsi_mid_low_api.txt | 3 +-- block/bsg-lib.c | 2 +- block/bsg.c | 2 +- block/scsi_ioctl.c

[PATCH 16/24] scsi: Kill DRIVER_TIMEOUT

2019-10-21 Thread Hannes Reinecke
Unused now. Signed-off-by: Hannes Reinecke --- drivers/scsi/constants.c| 2 +- include/scsi/scsi.h | 1 - include/trace/events/scsi.h | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c index b2ba83e6b98d

[PATCH 23/24] scsi: Kill DRIVER_MEDIA, DRIVER_SOFT, and DRIVER_BUSY

2019-10-21 Thread Hannes Reinecke
Unused. Signed-off-by: Hannes Reinecke --- drivers/message/fusion/mptscsih.c | 2 +- drivers/scsi/constants.c | 2 +- include/scsi/scsi.h | 8 include/trace/events/scsi.h | 5 + 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers

[PATCH 08/24] sg: use SAM status definitions and avoid using masked_status

2019-10-21 Thread Hannes Reinecke
Use standard SAM status definitions and avoid using masked status values. Signed-off-by: Hannes Reinecke --- drivers/scsi/sg.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index e88fb3daebcc..60ff388d04b9 100644 --- a

[PATCH 01/24] aic7xxx,aic79xxx: remove driver-defined SAM status definitions

2019-10-21 Thread Hannes Reinecke
Replace the driver-defined SAM status definitions with the standard mid-layer defined ones. Signed-off-by: Hannes Reinecke --- drivers/scsi/aic7xxx/aic79xx_core.c | 8 drivers/scsi/aic7xxx/aic79xx_osm.c | 16 drivers/scsi/aic7xxx/aic7xxx_core.c | 6 +++--- drivers

[PATCH RFC 00/24] scsi: Revamp result values

2019-10-21 Thread Hannes Reinecke
quot;scsi: qla2xxx: fixup incorrect usage of host_byte") from 5.4/scsi-fixes is a prerequisite for this patch series. Hannes Reinecke (24): aic7xxx,aic79xxx: remove driver-defined SAM status definitions bfa: drop driver-defined SCSI status codes wd33c93: use SCSI status acornscsi: us

[PATCH 12/24] scsi: introduce scsi_build_sense()

2019-10-21 Thread Hannes Reinecke
Introduce scsi_build_sense() as a wrapper around scsi_build_sense_buffer() to format the buffer and set the correct SCSI status. Signed-off-by: Hannes Reinecke --- drivers/ata/libata-scsi.c | 7 ++-- drivers/s390/scsi/zfcp_scsi.c | 5 +-- drivers/scsi/3w-.c

[PATCH 04/24] acornscsi: use standard defines

2019-10-21 Thread Hannes Reinecke
Use midlayer-defined values and drop the non-existing QUEUE_FULL case. Signed-off-by: Hannes Reinecke --- drivers/scsi/arm/acornscsi.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c index

[PATCH 07/24] target_core: Fixup target_complete_cmd() usage

2019-10-21 Thread Hannes Reinecke
target_complete_cmd() occasionally still uses the linux-specific SCSI result values; fix it up to use SAM result values throughout. Signed-off-by: Hannes Reinecke --- drivers/target/target_core_alua.c | 6 +++--- drivers/target/target_core_iblock.c | 2 +- drivers/target/target_core_pr.c

[PATCH 22/24] scsi: stop using DRIVER_ERROR

2019-10-21 Thread Hannes Reinecke
Return the actual error code in __scsi_execute() (which, according to the documentation, should have happened anyway). And audit all callers to cope with negative return values from __scsi_execute() and friends. Signed-off-by: Hannes Reinecke --- drivers/scsi/ch.c | 2 ++ drivers

[PATCH 13/24] scsi: Kill DRIVER_SENSE

2019-10-21 Thread Hannes Reinecke
Replace the check for DRIVER_SENSE with a check for SAM_STAT_CHECK_CONDITION and audit all callsites to ensure the SAM status is set correctly. Signed-off-by: Hannes Reinecke --- drivers/ata/libata-scsi.c | 13 - drivers/scsi/NCR5380.c | 2

[PATCH 18/24] st: return error code in st_scsi_execute()

2019-10-21 Thread Hannes Reinecke
We should return the actual error code in st_scsi_execute(), avoiding the need to use DRIVER_ERROR. Signed-off-by: Hannes Reinecke --- drivers/scsi/st.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index e3266a64a477..5f38369cc62f

[PATCH 17/24] scsi: do not use DRIVER_INVALID

2019-10-21 Thread Hannes Reinecke
Use DID_ERROR instead of DRIVER_INVALID, as it really doesn't matter if the driver or the device didn't understand the command. Signed-off-by: Hannes Reinecke --- drivers/scsi/constants.c| 3 +-- drivers/scsi/hptiop.c | 2 +- drivers/scsi/mvumi.c| 10 +- dr

[PATCH 03/24] wd33c93: use SCSI status

2019-10-21 Thread Hannes Reinecke
Use standard SCSI status and drop usage of the linux-specific ones. Signed-off-by: Hannes Reinecke --- drivers/scsi/wd33c93.c | 21 - 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c index f81046f0e68a

[PATCH 09/24] scsi: Kill obsolete linux-specific status codes

2019-10-21 Thread Hannes Reinecke
After several years it's time to finally kill them. Signed-off-by: Hannes Reinecke --- include/scsi/scsi_proto.h | 19 --- 1 file changed, 19 deletions(-) diff --git a/include/scsi/scsi_proto.h b/include/scsi/scsi_proto.h index c36860111932..660f37ce8721 100644 --- a/in

[PATCH 21/24] xen-scsiback: stop using DRIVER_ERROR

2019-10-21 Thread Hannes Reinecke
Return DID_ERROR instead of DRIVER_ERROR for internal failures. Signed-off-by: Hannes Reinecke --- drivers/xen/xen-scsiback.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c index e130b4426c62..6a12c3627098

[PATCH 02/24] bfa: drop driver-defined SCSI status codes

2019-10-21 Thread Hannes Reinecke
Drop the driver-defined SCSI status code and use the generic ones instead. Signed-off-by: Hannes Reinecke --- drivers/scsi/bfa/bfa_fc.h| 15 --- drivers/scsi/bfa/bfa_fcpim.c | 2 +- drivers/scsi/bfa/bfad_im.c | 2 +- 3 files changed, 2 insertions(+), 17 deletions(-) diff

[PATCH 05/24] scsi: use standard SAM status codes

2019-10-21 Thread Hannes Reinecke
Use standard SAM status codes and omit the explicit shift to convert to linus-specific ones. Signed-off-by: Hannes Reinecke --- drivers/ata/libata-scsi.c | 2 +- drivers/infiniband/ulp/srp/ib_srp.c | 2 +- drivers/scsi/3w-9xxx.c| 5 +++-- drivers/scsi/3w-sas.c

[PATCH 14/24] scsi: Kill DRIVER_HARD

2019-10-21 Thread Hannes Reinecke
Unused. Signed-off-by: Hannes Reinecke --- drivers/scsi/constants.c| 2 +- include/scsi/scsi.h | 1 - include/trace/events/scsi.h | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c index 7809bf618606

[PATCH 11/24] advansys: kill driver_defined status byte accessors

2019-10-21 Thread Hannes Reinecke
Replace the driver-defined status byte accessors by the mid-layer defined ones. Signed-off-by: Hannes Reinecke --- drivers/scsi/advansys.c | 78 + 1 file changed, 20 insertions(+), 58 deletions(-) diff --git a/drivers/scsi/advansys.c b/drivers

[PATCH 15/24] scsi_error: use DID_TIME_OUT instead of DRIVER_TIMEOUT

2019-10-21 Thread Hannes Reinecke
Set DID_TIME_OUT instead of DRIVER_TIMEOUT when a command is finally marked as failed after error recovery. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_error.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c

Re: [RFC PATCH 0/3] lpfc: nodelist pointer cleanup

2019-10-19 Thread Hannes Reinecke
On 10/18/19 11:45 PM, James Smart wrote: On 10/18/2019 12:50 AM, Hannes Reinecke wrote: Hi James, trying to figure this annoying lpfc_set_rrq_active() bug I've found the nodelist pointer handling in the lpfc io buffers a bit strange; there's a 'ndlp' pointer, but for

Re: [PATCH] scsi_dh_alua: Do not run STPG for implicit ALUA

2019-10-19 Thread Hannes Reinecke
[...] and then remove the redundant check in alua_stpg()? Good point. Will be resending the patch. Cheers, Hannes -- Dr. Hannes ReineckeTeamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409

[PATCH] scsi: fixup scsi_device_from_queue()

2019-10-18 Thread Hannes Reinecke
30a6c20791 ("scsi: core: add support for request batching") Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index c1c2998297b2..cd3e21a0098c 100644 --- a/dri

Re: [PATCH v5 00/13] scsi: core: fix uninit-value access of variable sshdr

2019-10-18 Thread Hannes Reinecke
w are actually in use: > > DRIVER_OK: 0 > DRIVER_BUSY: 0 > DRIVER_SOFT: 0 > DRIVER_MEDIA: 0 > DRIVER_ERROR: 6 Three less now :-) Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 247165 (AG München), GF: Felix Imendörffer

[PATCH] qla2xxx: fixup incorrect usage of host_byte

2019-10-18 Thread Hannes Reinecke
DRIVER_ERROR is a a driver byte setting, not a host byte. The qla2xxx driver should rather return DID_ERROR here to be in line with the other drivers. Signed-off-by: Hannes Reinecke --- drivers/scsi/qla2xxx/qla_bsg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

[PATCH] scsi_dh_alua: Do not run STPG for implicit ALUA

2019-10-18 Thread Hannes Reinecke
If a target only supports implicit ALUA sending a SET TARGET PORT GROUPS command is not only pointless, but might actually cause issues. So don't. Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers

Re: [PATCH v5 22/23] sg: sg_fill_request_element

2019-10-18 Thread Hannes Reinecke
set_map_data() > helper. All code refactoring, no logical change. > > Signed-off-by: Douglas Gilbert > --- > drivers/scsi/sg.c | 211 ++ > 1 file changed, 118 insertions(+), 93 deletions(-) > Reviewed-by: Hannes Reinecke Cheers

Re: [PATCH v5 21/23] sg: sg_find_srp_by_id

2019-10-18 Thread Hannes Reinecke
struct bio *bio;/* kept until this req -->SG_RS_INACTIVE */ > struct execute_work ew_orph;/* harvest orphan request */ cmd_opcode is used where? Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 247165 (AG München), GF: Felix Imendörffer

Re: [PATCH v5 20/23] sg: introduce request state machine

2019-10-18 Thread Hannes Reinecke
m sg_rq_state act_old_st = (enum sg_rq_state) > + atomic_cmpxchg(&srp->rq_st, old_st, new_st); > + > + if (act_old_st == old_st) > + return 0; /* implies new_st --> srp->rq_st */ > + else if (IS_ENABLED(CONFIG_SCSI_LOGGING)) > + sg_rep_rq_state_fail(srp->parentfp, old_st, new_st, > + act_old_st); > + return -EPROTOTYPE; > +} > -EPROTOTYPE? Now there someone has read POSIX ... why not simply -EINVAL as one would expect? Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 247165 (AG München), GF: Felix Imendörffer

Re: [PATCH v5 19/23] sg: rework scatter gather handling

2019-10-18 Thread Hannes Reinecke
> Signed-off-by: Douglas Gilbert > --- > drivers/scsi/sg.c | 275 +- > 1 file changed, 152 insertions(+), 123 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Sto

Re: [PATCH v5 18/23] sg: replace sg_allow_access

2019-10-18 Thread Hannes Reinecke
nly cosmetic. > > Signed-off-by: Douglas Gilbert > --- > drivers/scsi/sg.c | 149 +- > 1 file changed, 80 insertions(+), 69 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Sto

Re: [PATCH v5 17/23] sg: rework sg_mmap

2019-10-18 Thread Hannes Reinecke
lt; length) ? len : length; > + len = min_t(unsigned long, len, (unsigned long)length); > sa += len; > } > > Some comment regarding kernel-doc applies here, too. Anc the change in the 'for' condition above appears to be rather cosm

Re: [PATCH v5 16/23] sg: rework sg_vma_fault

2019-10-18 Thread Hannes Reinecke
t, len, sa; > + struct vm_area_struct *vma = vmf->vma; > struct sg_scatter_hold *rsv_schp; > - int k, length; > + struct sg_device *sdp; > + struct sg_fd *sfp; > const char *nbp = "==NULL, bad"; > > if (!vma) { Of course, one woul

Re: [PATCH v5 15/23] sg: sg_common_write add structure for arguments

2019-10-18 Thread Hannes Reinecke
rivers/scsi/sg.c | 47 --- > 1 file changed, 32 insertions(+), 15 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE Software Soluti

Re: [PATCH v5 14/23] sg: split sg_read

2019-10-18 Thread Hannes Reinecke
eive_v3', 'sg_read_v1v2' etc. And decide whether to use abbreviated or full names. IE either sg_read_v1v2 or sg_rd_v1v2, but if the latter than I would also prefer to have 'sg_rcv_v3'. Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networki

Re: [PATCH v5 13/23] sg: ioctl handling

2019-10-18 Thread Hannes Reinecke
t; /* Bit positions (flags) for sg_device::fdev_bm bitmask follow */ These defines are used only once; I'd rather drop them and do the conversion in-place. Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking h...@suse.de

Re: [PATCH v5 12/23] sg: change rwlock to spinlock

2019-10-18 Thread Hannes Reinecke
of that list is in the owning sf file descriptor object. > > Signed-off-by: Douglas Gilbert > --- > drivers/scsi/sg.c | 52 +++ > 1 file changed, 26 insertions(+), 26 deletions(-) > Reviewed-by: Hannes Reinecke Che

Re: [PATCH v5 05/23] sg: bitops in sg_device

2019-10-18 Thread Hannes Reinecke
dp = sdp->device; > @@ -2558,7 +2559,7 @@ sg_proc_seq_show_devstrs(struct seq_file *s, void *v) > read_lock_irqsave(&sg_index_lock, iflags); > sdp = it ? sg_lookup_dev(it->index) : NULL; > scsidp = sdp ? sdp->device : NULL; > - if (sdp && scsid

Re: [PATCH v5 11/23] sg: improve naming

2019-10-18 Thread Hannes Reinecke
ivers/scsi/sg.c | 234 +- > 1 file changed, 125 insertions(+), 109 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE Software Sol

Re: [PATCH v5 00/13] scsi: core: fix uninit-value access of variable sshdr

2019-10-18 Thread Hannes Reinecke
SE bit; so for things like hpsa or smartpqi the sense code is never evaluated after this patchset. I _really_ would prefer to ditch the 'DRIVER_SENSE' bit, and rely on scsi_sense_valid() only. Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 247165 (AG München), GF: Felix Imendörffer

[PATCH 1/3] lpfc: use named structure for combined I/O buffer

2019-10-18 Thread Hannes Reinecke
Use named structures in the combined I/O buffer to annotate the fields with the intended protocol usage. Signed-off-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_init.c | 2 +- drivers/scsi/lpfc/lpfc_nvme.c | 42 +- drivers/scsi/lpfc/lpfc_scsi.c | 190

[PATCH 3/3] lpfc: access nvme nodelist through nvme rport structure

2019-10-18 Thread Hannes Reinecke
sections. Signed-off-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_nvme.c | 14 -- drivers/scsi/lpfc/lpfc_sli.h | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c index defb19cdc7fe..80a58003b6aa 100644

[PATCH 2/3] lpfc: access nodelist through scsi-specific rdata pointer

2019-10-18 Thread Hannes Reinecke
Access the nodelist through the scsi-specific rdata pointer when handling SCSI requests. Signed-off-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_scsi.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index

[RFC PATCH 0/3] lpfc: nodelist pointer cleanup

2019-10-18 Thread Hannes Reinecke
e protocol-specific rport data structure. It also has the nice side-effect that the protocol-specific areas are aligned now, so clearing the 'rdata' pointer on the scsi side will be equivalent to clearing the 'rport' pointer on the nvme side. And it reduces the size of the io

[PATCH] lpfc: remove left-over BUILD_NVME defines

2019-10-17 Thread Hannes Reinecke
ingle per-cpu pair") Signed-off-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_init.c | 2 -- drivers/scsi/lpfc/lpfc_scsi.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index a0aa7a555811..6e6bb8da97d6 100644 --- a/dr

Re: [PATCH v2] scsi: Add sysfs attributes for VPD pages 0h and 89h

2019-10-08 Thread Hannes Reinecke
si_device.h > index 571ddb49b926..f4f176c79fae 100644 > --- a/include/scsi/scsi_device.h > +++ b/include/scsi/scsi_device.h > @@ -135,8 +135,10 @@ struct scsi_device { > const char * rev; /* ... "nullnullnullnull" before scan */ > > #define SCSI_

Re: [PATCH] scsi_dh_alua: handle RTPG sense code correctly during state transitions

2019-10-07 Thread Hannes Reinecke
On 10/7/19 10:45 PM, Ewan D. Milne wrote: > See below. > > On Mon, 2019-10-07 at 15:57 +0200, Hannes Reinecke wrote: >> From: Hannes Reinecke >> >> Some arrays are not capable of returning RTPG data during state >> transitioning, but rather return an 'LU

[PATCH] scsi_dh_alua: handle RTPG sense code correctly during state transitions

2019-10-07 Thread Hannes Reinecke
From: Hannes Reinecke Some arrays are not capable of returning RTPG data during state transitioning, but rather return an 'LUN not accessible, asymmetric access state transition' sense code. In these cases we can set the state to 'transitioning' directly and don't need

Re: [RFC,v2] scsi: scan: map PQ=1, PDT=other values to SCSI_SCAN_TARGET_PRESENT

2019-09-27 Thread Hannes Reinecke
) all RAID devices have the 'removable' flag set. This was done to support online resize of the RAID device, but then I'm not sure if it's still required. I for once would be happy to see that go. Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & N

Re: [PATCH] scsi: Add sysfs attributes for VPD pages 0h and 89h

2019-09-26 Thread Hannes Reinecke
scsi/scsi_device.h > index 571ddb49b926..5e91b0d00393 100644 > --- a/include/scsi/scsi_device.h > +++ b/include/scsi/scsi_device.h > @@ -137,6 +137,8 @@ struct scsi_device { > #define SCSI_VPD_PG_LEN255 > struct scsi_vpd __rcu *vpd_pg83; > struct scs

Re: [PATCH RFC 00/24] scsi: enable reserved commands for LLDDs

2019-09-09 Thread Hannes Reinecke
On 9/2/19 10:47 AM, John Garry wrote: > On 26/08/2019 16:27, Hannes Reinecke wrote: >> On 8/23/19 3:26 PM, John Garry wrote: >>> On 29/05/2019 14:28, Hannes Reinecke wrote: >>>> Hi all, >>>> >>>> quite some drivers use internal commands fo

Re: [PATCH v4 12/22] sg: sense buffer rework

2019-09-09 Thread Hannes Reinecke
> 0) { > + if (scsi_rp->sense) { > + srp->sense_bp = mempool_alloc(sg_sense_pool, > + GFP_ATOMIC); > + if (srp->sense_bp) > + memcpy(srp->sense_

Re: [PATCH v4 10/22] sg: remove access_ok functions

2019-09-09 Thread Hannes Reinecke
t;. > > Signed-off-by: Douglas Gilbert > --- > drivers/scsi/sg.c | 85 ++- > 1 file changed, 32 insertions(+), 53 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Te

Re: [PATCH] scsi: fcoe: fix null-ptr-deref Read in fc_release_transport

2019-09-09 Thread Hannes Reinecke
ef Read in fc_release_transport. >> >> fcoe_exit >> fcoe_if_exit >> fc_release_transport(fcoe_vport_scsi_transport) >> >> Reported-by: Hulk Robot >> Signed-off-by: zhengbin >> --- >> drivers/scsi/fcoe/fcoe.c | 16 +++- >> 1 fil

Re: [PATCH] lpfc: Raise config max for lpfc_fcp_mq_threshold variable

2019-08-28 Thread Hannes Reinecke
On 8/27/19 11:28 PM, James Smart wrote: Raise the config max for lpfc_fcp_mq_threshold variable to 256. Signed-off-by: Dick Kennedy Signed-off-by: James Smart CC: Hannes Reinecke --- Martin, this fix applies 5.3/scsi-fixes patch: scsi: lpfc: Mitigate high memory pre-allocation by SCSI-MQ

Re: [PATCH] lpfc: Remove bg debugfs buffers

2019-08-28 Thread Hannes Reinecke
: KyleMahlkuch CC: Hannes Reinecke --- drivers/scsi/lpfc/lpfc.h | 2 - drivers/scsi/lpfc/lpfc_crtn.h| 10 --- drivers/scsi/lpfc/lpfc_debugfs.c | 134 --- drivers/scsi/lpfc/lpfc_init.c| 70 drivers/scsi/lpfc

Re: [PATCH 00/42] lpfc: Update lpfc to revision 12.4.0.0

2019-08-27 Thread Hannes Reinecke
.381377] local_pci_probe+0x42/0x90 Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 247165 (AG München), GF: Felix Imendörffer

Re: [PATCH RFC 00/24] scsi: enable reserved commands for LLDDs

2019-08-26 Thread Hannes Reinecke
On 8/23/19 3:26 PM, John Garry wrote: > On 29/05/2019 14:28, Hannes Reinecke wrote: >> Hi all, >> >> quite some drivers use internal commands for various purposes, most >> commonly sending TMFs or querying the HBA status. >> While these commands use the same submis

Re: 答复: [PATCH] scsi_dh_alua: always use a 2 seconds delay before retrying RTPG

2019-08-26 Thread Hannes Reinecke
necessary condition for codes > style? > Thanks very much!  > Yes, it is, as the 'interval' setting might've been set already, in which case we shouldn't be modifying it. Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking h...@suse.

Re: [PATCH v3] lpfc: Mitigate high memory pre-allocation by SCSI-MQ

2019-08-26 Thread Hannes Reinecke
h setup-specific. However, I'm somewhat loath to have a cap at 128; we actually have several machines where we'll be having more CPUs than that. Can't we increase the cap to 512 to give us a bit more leeway during testing? Cheers, Hannes -- Dr. Hannes Reinecke Te

Re: [PATCH 3/3] scsi: qla2xxx: calculate dump size if EFT alloc fails

2019-08-13 Thread Hannes Reinecke
FT ...\n", EFT_SIZE / 1024); > @@ -3211,6 +3211,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) > ha->eft = tc; > } > > +calc_dump_size: > if (IS_QLA27XX(ha) || IS_QLA28XX(ha)) { > struct fwdt *fwdt = ha->fwdt

Re: [PATCH 2/3] scsi: qla2xxx: unset RCE/EFT fields in failure case

2019-08-13 Thread Hannes Reinecke
y this is even there. Right at the start we have: if (ha->eft) { ql_dbg(ql_dbg_init, vha, 0x00bd, "%s: Offload Mem is already allocated.\n", __func__); return; } IE the second half of this function

Re: [PATCH 1/3] scsi: qla2xxx: qla2x00_alloc_fw_dump: set ha->eft

2019-08-13 Thread Hannes Reinecke
x00_alloc_fw_dump(scsi_qla_host_t *vha) > ql_dbg(ql_dbg_init, vha, 0x00c3, > "Allocated (%d KB) EFT ...\n", EFT_SIZE / 1024); > eft_size = EFT_SIZE; > + ha->eft_dma = tc_dma; > + ha->eft = tc; >

Re: [PATCH v2] lpfc: Mitigate high memory pre-allocation by SCSI-MQ

2019-08-06 Thread Hannes Reinecke
rivers/scsi/lpfc/lpfc_sli4.h > @@ -44,6 +44,11 @@ > #define LPFC_HBA_HDWQ_MAX128 > #define LPFC_HBA_HDWQ_DEF 0 > > +/* FCP MQ queue count limiting */ > +#define LPFC_FCP_MQ_THRESHOLD_MIN0 > +#define LPFC_FCP_MQ_THRESHOLD_MAX128 > +#define LPFC_FCP_MQ_THRE

Re: [PATCH v2 16/18] sg: expand sg_comm_wr_t

2019-07-29 Thread Hannes Reinecke
+-- > 1 file changed, 92 insertions(+), 86 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckeTeamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5,

Re: [PATCH v2 15/18] sg: add 8 byte SCSI LUN to sg_scsi_id

2019-07-29 Thread Hannes Reinecke
si_lun array field henceforth but existing code > can remain as it is and will get the same 'lun' value with > the version 3 or version 4 driver. > > Signed-off-by: Douglas Gilbert > --- > drivers/scsi/sg.c | 5 +++-- > include/uapi/scsi/sg.h | 5 - > 2

Re: [PATCH v2 10/18] sg: remove most access_ok functions

2019-07-29 Thread Hannes Reinecke
t;. > > Signed-off-by: Douglas Gilbert > --- > drivers/scsi/sg.c | 50 --- > 1 file changed, 17 insertions(+), 33 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckeTe

Re: [PATCH v2 09/18] sg: sg_allow_if_err_recovery and renames

2019-07-29 Thread Hannes Reinecke
triggered by > checkpatch.pl . > > Signed-off-by: Douglas Gilbert > --- > drivers/scsi/sg.c | 245 +- > 1 file changed, 133 insertions(+), 112 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke

Re: [PATCH v2 06/18] sg: make open count an atomic

2019-07-29 Thread Hannes Reinecke
; 1 file changed, 20 insertions(+), 19 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckeTeamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörff

Re: [PATCH v2 07/18] sg: move header to uapi section

2019-07-29 Thread Hannes Reinecke
t; include/scsi/sg.h | 268 ++--- > include/uapi/scsi/sg.h | 329 + > 2 files changed, 338 insertions(+), 259 deletions(-) > create mode 100644 include/uapi/scsi/sg.h > Reviewed-by: Hannes Reinecke Cheers

Re: [PATCH v2 08/18] sg: speed sg_poll and sg_get_num_waiting

2019-07-29 Thread Hannes Reinecke
) interfaces. > > Signed-off-by: Douglas Gilbert > --- > drivers/scsi/sg.c | 54 +++ > 1 file changed, 27 insertions(+), 27 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckeTeamlead Sto

Re: [PATCH v2 03/18] sg: sg_log and is_enabled

2019-07-29 Thread Hannes Reinecke
macro is shorter than > SCSI_LOG_TIMEOUT macro allow more error message "payload" per line. > > Also replace #if and #ifdef conditional compilations with > the IS_ENABLED macro. > > Signed-off-by: Douglas Gilbert > --- > drivers/scsi/sg.c | 252 ++

Re: [PATCH v2 04/18] sg: rework sg_poll(), minor changes

2019-07-29 Thread Hannes Reinecke
rivers/scsi/sg.c | 65 ++- > 1 file changed, 30 insertions(+), 35 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckeTeamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE L

Re: [PATCH v2 02/18] sg: remove typedefs, type+formatting cleanup

2019-07-29 Thread Hannes Reinecke
moved. > > Signed-off-by: Douglas Gilbert > --- > drivers/scsi/sg.c | 394 ++ > 1 file changed, 219 insertions(+), 175 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke

Re: [PATCH v2 01/18] sg: move functions around

2019-07-29 Thread Hannes Reinecke
eclarations needed. > > Signed-off-by: Douglas Gilbert > --- > drivers/scsi/sg.c | 499 -- > 1 file changed, 261 insertions(+), 238 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke

Re: [PATCH v2 14/18] sg: rework debug info

2019-07-29 Thread Hannes Reinecke
working everything, can't we move this particular information to debugfs? I really would love to deprecate /proc/scsi in the near future, so we shouldn't be adding more stuff to it. Cheers, Hannes -- Dr. Hannes ReineckeTeamlead Storage & Networking h...@suse.d

Re: [PATCH v2 13/18] sg: add sg v4 interface support

2019-07-29 Thread Hannes Reinecke
_cred()) { > pr_err_once("%s: process %d (%s) changed security contexts > after opening file descriptor, this is not allowed.\n", > caller, task_tgid_vnr(current), current->comm); > @@ -347,10 +374,11 @@ sg_check_file_access(struct file *filp, const char > *caller) > > static int > sg_wait_open_event(struct sg_device *sdp, bool o_excl) > + __must_hold(&sdp->open_rel_lock) This actually has nothing to do with the sg4 interface support. Please move out locking annotations into a separate patch. Cheers, Hannes -- Dr. Hannes ReineckeTeamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg)

Re: [PATCH v2 12/18] sg: sense buffer rework

2019-07-29 Thread Hannes Reinecke
ontext(struct work_struct *work) > list_del(&srp->fl_entry); > if (srp->sgat_h.buflen > 0) > sg_remove_sgat(srp); > + kfree(srp->sense_bp); > SG_LOG(6, sfp, "%s: fl%s%p --\n", __func__, cp, srp); > kfree(srp); > } > Maybe it's worthwhile using a mempool here for sense buffers; frequest kmalloc()/kfree() really should be avoided. Also the allocation at end_io time is slightly dodgy; I'd rather have the sense allocated before setting up the command. Thing is, the end_io callback might be called at any time and in about every context (including from an interrupt handler), so I really would avoid having to do kmalloc() there. Cheers, Hannes -- Dr. Hannes ReineckeTeamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg)

Re: [PATCH v2 05/18] sg: bitops in sg_device

2019-07-29 Thread Hannes Reinecke
xclude = true; > + set_bit(SG_FDEV_EXCLUDE, sdp->fdev_bm); > > if (sdp->open_cnt < 1) { /* no existing opens */ > - sdp->sgdebug = 0; > + clear_bit(SG_FDEV_LOG_SENSE, sdp->fdev_bm); > q = sdp->device->

Re: [PATCH 4/4] Reduce memory required for SCSI logging

2019-07-28 Thread Hannes Reinecke
illa.kernel.org/show_bug.cgi?id=204119. > See also commit ded85c193a39 ("scsi: Implement per-cpu logging buffer") # > v4.0. > > Reported-by: Jan Palus > Cc: Christoph Hellwig > Cc: Hannes Reinecke > Cc: Johannes Thumshirn > Cc: Ming Lei > Cc: Jan Palus >

[PATCHv3 0/3] fcoe: cleanup fc_rport_priv usage

2019-07-24 Thread Hannes Reinecke
rport_priv into fcoe_rport, and use the fcoe_rport structure wherever possible. This patchset also contains some minor whitespace cleanups for libfc.h. As usual, comments and reviews are welcome. Changes to v1: - Drop patch to remove lld_event_callback Changes to v2: - Include reviews from Christo

[PATCH 2/3] fcoe: Embed fc_rport_priv in fcoe_rport structure

2019-07-24 Thread Hannes Reinecke
ntainer_of' outcast, and will only have to do a memset over one structure. Signed-off-by: Hannes Reinecke --- drivers/scsi/fcoe/fcoe_ctlr.c | 51 +-- drivers/scsi/libfc/fc_rport.c | 5 - include/scsi/libfcoe.h| 1 + 3 files changed, 25 in

[PATCH 1/3] libfc: Whitespqce cleanup in libfc.h

2019-07-24 Thread Hannes Reinecke
No functional change. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- include/scsi/libfc.h | 52 ++-- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 76cb9192319a

[PATCH 3/3] fcoe: pass in fcoe_rport structure instead of fc_rport_priv

2019-07-24 Thread Hannes Reinecke
Instead of using the generic 'fc_rport_priv' structure as argument and then having to painstakingly outcast this to fcoe_rport we should be passing the fcoe_rport structure itself and reduce complexity. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers

  1   2   3   4   5   6   7   8   9   10   >