Re: [PATCH v9 06/15] mlx5: Replace PCI pool old API

2017-05-23 Thread Romain Perier
Hello, Le 23/05/2017 à 09:27, Leon Romanovsky a écrit : > On Mon, May 22, 2017 at 06:48:58PM +0200, Romain Perier wrote: >> The PCI pool API is deprecated. This commit replaces the PCI pool old >> API by the appropriate function with the DMA pool API. >> >> Signed-off-by: Romain Perier

Re: [PATCH blktests v2 3/3] sg/001: add regression test for syzcaller generated GPF in sg_read path

2017-05-23 Thread Johannes Thumshirn
On 05/22/2017 07:59 PM, Omar Sandoval wrote: > This looks much better, thanks! One question for you: is there any value > in running this on specific test devices (i.e., changing test() to > test_device() and using "$TEST_DEV" instead of a scsi-debug device), or > would it be a waste of time since

Re: [PATCH v9 06/15] mlx5: Replace PCI pool old API

2017-05-23 Thread Leon Romanovsky
On Mon, May 22, 2017 at 06:48:58PM +0200, Romain Perier wrote: > The PCI pool API is deprecated. This commit replaces the PCI pool old > API by the appropriate function with the DMA pool API. > > Signed-off-by: Romain Perier > Reviewed-by: Peter Senna Tschudin

Re: [PATCH 1/2] libsas: Don't process sas events in static works

2017-05-23 Thread wangyijing
>> > > I have seen this scenario on our development board when we have a bad > physical cable connection - the PHY continually goes up and down in a loop. > > So, in this regard, it is worth safeguarding against this scenario. OK, I will reconsider this case. Thanks! Yijing. > > John > >

Re: [PATCH] qla2xxx: Remove an unused structure member

2017-05-23 Thread Christoph Hellwig
On Mon, May 22, 2017 at 01:10:53PM -0700, Bart Van Assche wrote: > qla_tgt_cmd.free_work is not used by the qla2xxx driver. Hence > remove that member of struct qla_tgt_cmd. Looks fine, Reviewed-by: Christoph Hellwig

[PATCH 09/15] qedf: Add bus_reset No-op.

2017-05-23 Thread Dupuis, Chad
We need to add a bus reset no-op as without it some of the LUNs attached to a vport may go offline when the error handler escalates to host reset due to not having a bus reset handler in the driver. What happens is we escalate to host reset which does a soft link down/link up to reset the adapter.

[PATCH 15/15] qedf: Update version number to 8.18.22.0.

2017-05-23 Thread Dupuis, Chad
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 d46c487..6fa4420 100644 ---

[PATCH 07/15] qedf: Set qed logging level to QED_LEVEL_NOTICE.

2017-05-23 Thread Dupuis, Chad
Reduce the logging level we set for qed messages pertaining to this PCI function so that unnecessary messages are not printed in the kernel message log. Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 05/15] qedf: Check that fcport is offloaded before dereferencing pointers in initiate_abts|cleanup.

2017-05-23 Thread Dupuis, Chad
If an fcport is not offloaded then the members of the qedf_rport struct are undefined which may cause a system crash. Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf_io.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git

[PATCH 04/15] qedf: Look at all descriptors when processing a clear virtual link.

2017-05-23 Thread Dupuis, Chad
If there are multiple descriptors for a particular type in a clear virtual link we receive, we will not process it correctly but rather take the last value. This can cause us not to not flap the virtual link as the value from the descriptors that we compare against the our stored FCF or fc_lport

[PATCH 01/15] qedf: Enable basic FDMI information.

2017-05-23 Thread Dupuis, Chad
For libfc to register FDMI attributes we need to do two things: - Set the appropriate fc_host attributes that libfc will use to form the FDMI registration commands - Set lport->fdmi_enabled to 1 Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf_main.c | 57

[PATCH 08/15] qedf: Use same logic for SCSI host reset and FC lip_reset.

2017-05-23 Thread Dupuis, Chad
We should be using the same logic to do a soft reset of the FCoE function whether it is initiated via sg_reset or the fc_host issue_lip attribute. Refactor the host reset and fcoe reset handlers to use the preferred logic which is currently contained in qedf_eh_host_reset(). Signed-off-by: Chad

[PATCH 02/15] qedf: Update copyright to 2017.

2017-05-23 Thread Dupuis, Chad
Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/drv_fcoe_fw_funcs.c | 2 +- drivers/scsi/qedf/drv_fcoe_fw_funcs.h | 2 +- drivers/scsi/qedf/drv_scsi_fw_funcs.c | 2 +- drivers/scsi/qedf/drv_scsi_fw_funcs.h | 2 +- drivers/scsi/qedf/qedf.h | 2 +-

[PATCH 00/15] qedf: Update driver to version 8.18.22.0.

2017-05-23 Thread Dupuis, Chad
Hi Martin, Please apply the following patches to the scsi tree at your earliest convenience. Thanks, Chad Dupuis, Chad (15): qedf: Enable basic FDMI information. qedf: Update copyright to 2017. qedf: Honor qed_ops->common->set_fp_int() return code. qedf: Look at all descriptors when

[PATCH 12/15] qedf: Move some prints to a debug level so they do not print when no debugging is enabled.

2017-05-23 Thread Dupuis, Chad
Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf_main.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 7d1a953..340cf74 100644 ---

[PATCH 06/15] qedf: Add fka_period SCSI host attribute to show fip keep alive period.

2017-05-23 Thread Dupuis, Chad
Expose this information for interested applications. Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf_attr.c | 60 +-- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/drivers/scsi/qedf/qedf_attr.c

[PATCH 03/15] qedf: Honor qed_ops->common->set_fp_int() return code.

2017-05-23 Thread Dupuis, Chad
We need to check the return code the set_fp_int() callback in case we were not allocated any fastpath interrupts or there was an error setting up the fastpath interrupts from the qed perspective. Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf_main.c | 2 ++ 1 file

[PATCH 13/15] qedf: Change cmd_per_lun in scsi_host_template to 32 to increase performance.

2017-05-23 Thread Dupuis, Chad
Increase the default number of commands that the driver tells the SCSI mid-layer it can do to increase the default performance of the driver. Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 10/15] qedf: Add non-offload receive filters.

2017-05-23 Thread Dupuis, Chad
Drop invalid or unexpected FCoE frames that come into the non-offload path since the FCoE firmware would not do the filtering for us. Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf_main.c | 46 +++ 1 file changed, 46

[PATCH 11/15] qedf: Fixup unnecessary paratheses around test_bit operations.

2017-05-23 Thread Dupuis, Chad
Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf_els.c | 6 +++--- drivers/scsi/qedf/qedf_io.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qedf/qedf_els.c b/drivers/scsi/qedf/qedf_els.c index e197fd6..78d9f1c 100644 ---

[PATCH 14/15] qedf: Add change_queue_depth member to scsi_host_template().

2017-05-23 Thread Dupuis, Chad
Add the change_queue_depth member to our SCSI host template so the queue depth of devices attached to qedf can be changed dynamically. Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf_main.c | 1 + 1 file changed, 1 insertion(+) diff --git

Re: [PATCH blktests v2 3/3] sg/001: add regression test for syzcaller generated GPF in sg_read path

2017-05-23 Thread Jens Axboe
On 05/23/2017 12:58 AM, Johannes Thumshirn wrote: > On 05/22/2017 07:59 PM, Omar Sandoval wrote: >> This looks much better, thanks! One question for you: is there any value >> in running this on specific test devices (i.e., changing test() to >> test_device() and using "$TEST_DEV" instead of a

Re: [PATCH blktests v2 3/3] sg/001: add regression test for syzcaller generated GPF in sg_read path

2017-05-23 Thread Johannes Thumshirn
On 05/23/2017 04:15 PM, Jens Axboe wrote: > Add some code to the framework that allows you to get the corresponding > SG device for a SCSI block device? Make that part of the prepare, skip > the test if the block device isn't a SCSI dev. Well the code is already there (in patch 2/3). I'll pack

Re: [PATCH blktests v2 3/3] sg/001: add regression test for syzcaller generated GPF in sg_read path

2017-05-23 Thread Johannes Thumshirn
On 05/23/2017 04:39 PM, Jens Axboe wrote: > I tried to look up that commit: > > 48ae8484e9fc ("scsi: sg: don't return bogus Sg_requests") > > but that isn't in Linus' tree. Even searched for just the title, still > didn't find anything. It's queued up in Martin's tree [1]. > > I'm assuming

[PATCH] scsi: lpfc: prevent potential null pointer dereference

2017-05-23 Thread Gustavo A. R. Silva
Null check at line 966: if (ndlp) {, implies that ndlp might be NULL. Functions lpfc_nlp_set_state() and lpfc_issue_els_prli() dereference pointer ndlp. Include these function calls inside the IF block that tests pointer ndlp. Addresses-Coverity-ID: 1401856 Signed-off-by: Gustavo A. R. Silva

Re: [PATCH blktests v2 3/3] sg/001: add regression test for syzcaller generated GPF in sg_read path

2017-05-23 Thread Jens Axboe
On 05/23/2017 08:25 AM, Johannes Thumshirn wrote: > On 05/23/2017 04:15 PM, Jens Axboe wrote: >> Add some code to the framework that allows you to get the corresponding >> SG device for a SCSI block device? Make that part of the prepare, skip >> the test if the block device isn't a SCSI dev. > >

Re: [PATCH v9 06/15] mlx5: Replace PCI pool old API

2017-05-23 Thread David Miller
From: Romain Perier Date: Tue, 23 May 2017 10:53:36 +0200 > Hello, > > > Le 23/05/2017 à 09:27, Leon Romanovsky a écrit : >> On Mon, May 22, 2017 at 06:48:58PM +0200, Romain Perier wrote: >>> The PCI pool API is deprecated. This commit replaces the PCI pool old >>>

[PATCH] qla2xxx: don't disable a not previously enabled PCI device

2017-05-23 Thread Johannes Thumshirn
When pci_enable_device() or pci_enable_device_mem() fail in qla2x00_probe_one() we bail out but do a call to pci_disable_device(). This causes the dev_WARN_ON() in pci_disable_device() to trigger, as the device wasn't enabled previously. So instead of taking the 'probe_out' error path we can

Re: Need help with handling failed ATA pass-through command and sense data

2017-05-23 Thread Alan Stern
On Thu, 18 May 2017, Ewan D. Milne wrote: > On Thu, 2017-05-18 at 13:37 -0400, Alan Stern wrote: > > > > I had completely forgotten about this code. :-( > > > > Looks like you put your finger on the source of the problem. So if the > > device sends back essentially empty sense data (SK = No

[PATCH 26/31] scsi: Move the code for clearing private command data into scsi_dispatch_cmd()

2017-05-23 Thread Bart Van Assche
This patch does not change any functionality but avoids duplication of the code for clearing driver-private command data. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke --- drivers/scsi/scsi_lib.c | 5 ++--- 1

[PATCH 01/31] Split scsi_internal_device_block()

2017-05-23 Thread Bart Van Assche
Instead of passing a "wait" argument to scsi_internal_device_block(), split this function into a function that waits and a function that doesn't wait. This will make it easier to serialize SCSI device state changes through a mutex. Signed-off-by: Bart Van Assche Cc:

[PATCH 10/31] Avoid that scsi_exit_rq() triggers a use-after-free

2017-05-23 Thread Bart Van Assche
Dereferencing shost from scsi_exit_rq() is not safe because the SCSI host may already have been freed when scsi_exit_rq() is called. Increasing the shost reference count in scsi_init_rq() and dropping that reference in scsi_exit_rq() is nontrivial since scsi_host_dev_release() may sleep and since

[PATCH 15/31] nfsd: Check private request size before submitting a SCSI request

2017-05-23 Thread Bart Van Assche
Since using scsi_req() is only allowed against request queues for which struct scsi_request is the first member of their private request data, refuse to submit SCSI commands against a queue for which this is not the case. References: commit 82ed4db499b8 ("block: split scsi_request out of struct

[PATCH 18/31] block: Make scsi_req_init() calls implicit

2017-05-23 Thread Bart Van Assche
Instead of explicitly calling scsi_req_init(), let blk_get_request() call that function from inside blk_rq_init(). Add an .initialize_rq_fn() callback function to the block drivers that need it. Merge the IDE .init_rq_fn() function into .initialize_rq_fn() because it is too small to keep it as a

[PATCH 17/31] block: Introduce request_queue.initialize_rq_fn()

2017-05-23 Thread Bart Van Assche
Several block drivers need to initialize the driver-private data after having called blk_get_request() and before .prep_rq_fn() is called, e.g. when submitting a REQ_OP_SCSI_* request. Avoid that that initialization code has to be repeated after every blk_get_request() call by adding a new

[PATCH 25/31] scsi-mq: Make behavior scsi_mq_prep_fn() closer to that of scsi_prep_fn()

2017-05-23 Thread Bart Van Assche
Instead of clearing most of struct scsi_cmnd and reinitializing it, rely on scsi_initialize_rq() for initialization of struct scsi_cmnd. This patch fixes a bug, namely that it avoids that jiffies_at_alloc gets overwritten if a request is requeued. Signed-off-by: Bart Van Assche

[PATCH 28/31] scsi_setup_fs_cmnd(): Call scsi_req_init() instead of open-coding it

2017-05-23 Thread Bart Van Assche
The only functional change is that this patch causes scsi_setup_fs_cmnd() to clear scsi_request.sense_len. Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Cc: Hannes Reinecke --- drivers/scsi/scsi_lib.c | 4 ++-- 1 file

[PATCH 22/31] scsi: Inline scsi_init_command()

2017-05-23 Thread Bart Van Assche
The two drivers that use the per-device command list, namely aacraid and dpt_i2o, expect that that list contains only SCSI commands and no task management functions. Hence only call scsi_add_cmd_to_list() from the block layer prep callback functions and not from scsi_ioctl_reset(). Signed-off-by:

[PATCH 30/31] scsi: virtio: Remove code that zeroes driver-private command data

2017-05-23 Thread Bart Van Assche
Since the SCSI core zeroes driver-private command data, remove that code from the virtio driver. Signed-off-by: Bart Van Assche Cc: Michael S. Tsirkin Cc: Christoph Hellwig Cc: Hannes Reinecke ---

[PATCH 19/31] scsi: Change argument type of scsi_req_init()

2017-05-23 Thread Bart Van Assche
Since scsi_req_init() works on a struct scsi_request, change the argument type into struct scsi_request *. Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Cc: Hannes Reinecke --- block/scsi_ioctl.c| 10

[PATCH 09/31] block: Avoid that blk_exit_rl() triggers a use-after-free

2017-05-23 Thread Bart Van Assche
Since the introduction of the .init_rq_fn() and .exit_rq_fn() it is essential that the memory allocated for struct request_queue stays around until all blk_exit_rl() calls have finished. Hence make blk_init_rl() take a reference on struct request_queue. This patch fixes the following crash:

[PATCH 23/31] scsi: Move sense buffer pointer initialization into scsi_initialize_rq()

2017-05-23 Thread Bart Van Assche
This patch is a preparation for the next patch that will zero the struct scsi_request embedded in struct scsi_cmnd before calling scsi_req_init(). Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Cc: Hannes Reinecke ---

[PATCH 13/31] pktcdvd: Check queue type before attaching to a queue

2017-05-23 Thread Bart Van Assche
Since the pktcdvd driver only supports request queues for which struct scsi_request is the first member of their private request data, refuse to register block layer queues for which struct scsi_request is not the first member of the private data. References: commit 82ed4db499b8 ("block: split

[PATCH 12/31] bsg: Check queue type before attaching to a queue

2017-05-23 Thread Bart Van Assche
Since BSG only supports request queues for which struct scsi_request is the first member of their private request data, refuse to register block layer queues for which struct scsi_request is not the first member of their private data. References: commit bd1599d931ca ("scsi_transport_sas: fix BSG

[PATCH 00/31] SCSI patches for kernel v4.13.

2017-05-23 Thread Bart Van Assche
Hello Martin, This patch series consists of the bug fixes I came up with during the past two months. Please consider these patches for kernel v4.13. Thanks, Bart. Bart Van Assche (31): Split scsi_internal_device_block() Create two versions of scsi_internal_device_unblock() Protect SCSI

[PATCH 02/31] Create two versions of scsi_internal_device_unblock()

2017-05-23 Thread Bart Van Assche
This will make it easier to serialize SCSI device state changes through a mutex. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Sreekanth Reddy

[PATCH 05/31] Make __scsi_remove_device go straight from BLOCKED to DEL

2017-05-23 Thread Bart Van Assche
If a device is blocked, make __scsi_remove_device() cause it to transition to the DEL state. This means that all the commands issued in .shutdown() will error in the mid-layer, thus making the removal proceed without being stopped. This patch is a slightly modified version of a patch from James

[PATCH 16/31] scsi: Make scsi_ioctl_reset() pass the request queue pointer to blk_rq_init()

2017-05-23 Thread Bart Van Assche
A later patch will add a call to a request initialization function into blk_rq_init(). Hence make sure that all blk_rq_init() calls specify the request queue pointer. Since TMF callback functions in SCSI LLD drivers do not use request.q, this patch does not change the behavior of any SCSI driver.

[PATCH 03/31] Protect SCSI device state changes with a mutex

2017-05-23 Thread Bart Van Assche
Enable this mechanism for all scsi_target_*block() callers but not for the scsi_internal_device_unblock() calls from the mpt3sas driver because that driver can call scsi_internal_device_unblock() from atomic context. Signed-off-by: Bart Van Assche Cc: Christoph

[PATCH 21/31] scsi: Move most of scsi_init_command() into scsi_initialize_rq()

2017-05-23 Thread Bart Van Assche
Move the initializations that only have to be performed once and not every time a request is prepared from scsi_init_command() into scsi_initialize_rq(). This patch also moves the jiffies_at_alloc assignment such that it gets back the meaning it had before commit e9c787e65c0c, namely the value of

[PATCH 14/31] cdrom: Check private request size before attaching to a queue

2017-05-23 Thread Bart Van Assche
Since the cdrom driver only supports request queues for which struct scsi_request is the first member of their private request data, refuse to register block layer queues for which this is not the case. References: commit 82ed4db499b8 ("block: split scsi_request out of struct request")

[PATCH 31/31] xen/scsifront: Remove code that zeroes driver-private command data

2017-05-23 Thread Bart Van Assche
Since the SCSI core zeroes driver-private command data, remove that code from the xen-scsifront driver. Signed-off-by: Bart Van Assche Cc: Juergen Gross Cc: xen-de...@lists.xenproject.org --- drivers/scsi/xen-scsifront.c | 1 - 1 file changed, 1

[PATCH 29/31] scsi: snic: Remove code that zeroes driver-private command data

2017-05-23 Thread Bart Van Assche
Since the SCSI core zeroes driver-private command data, remove that code from the snic driver. Signed-off-by: Bart Van Assche Cc: Narsimhulu Musini Cc: Sesidhar Baddela Cc: Christoph Hellwig Cc: Hannes Reinecke

[PATCH 08/31] sd, sr: Convert two assignments into warning statements

2017-05-23 Thread Bart Van Assche
Before scsi_prep_fn() calls the ULP .init_command() callback function it stores the SCSI command pointer in request.special. This means that the SCpnt = rq->special assignments in the sd and sr drivers assign a pointer to itself. Hence convert these two assignment statements into warning

[PATCH 20/31] scsi: Only add commands to the device command list if required by the LLD

2017-05-23 Thread Bart Van Assche
Just like for the scsi-mq code path, in the single queue SCSI code path only add commands to the per-device command list if required by the SCSI LLD. This patch will make it easier to merge the single-queue and multiqueue command initialization code. Signed-off-by: Bart Van Assche

[PATCH 04/31] Introduce scsi_start_queue()

2017-05-23 Thread Bart Van Assche
This patch does not change any functionality. Signed-off-by: Bart Van Assche Cc: Israel Rukshin Cc: Max Gurtovoy Cc: Hannes Reinecke Cc: Benjamin Block --- drivers/scsi/scsi_lib.c

[PATCH 11/31] block: Introduce queue flag QUEUE_FLAG_SCSI_SUP

2017-05-23 Thread Bart Van Assche
>From the context where a SCSI command is submitted it is not always possible to figure out whether or not the queue the command is submitted to has struct scsi_request as the first member of its private data. Hence introduce the flag QUEUE_FLAG_SCSI_SUP. Signed-off-by: Bart Van Assche

[PATCH 24/31] scsi: Make scsi_initialize_rq() zero the entire struct scsi_cmnd

2017-05-23 Thread Bart Van Assche
This simplifies the memset() call in scsi_initialize_rq() and avoids that any stale data is left behind in struct scsi_request. Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Cc: Hannes Reinecke --- drivers/scsi/scsi_lib.c

[PATCH 07/31] scsi: Use blk_mq_rq_to_pdu() to convert a request to a SCSI command pointer

2017-05-23 Thread Bart Van Assche
Since commit e9c787e65c0c ("scsi: allocate scsi_cmnd structures as part of struct request") struct request and struct scsi_cmnd are adjacent. This means that there is now an alternative to reading req->special to convert a pointer to a prepared request into a SCSI command pointer, namely by using

[PATCH 06/31] scmd_eh_abort_handler(): Add a comment

2017-05-23 Thread Bart Van Assche
After the patch that introduced this function was posted on the linux-scsi mailing list an explanation was posted why this patch is correct. Since that explanation contains important information, add a summary of it above the code that explanation applies to. See also

[PATCH 27/31] scsi: Consolidate more initialization code

2017-05-23 Thread Bart Van Assche
Initialize struct scsi_cmnd.request from inside scsi_initialize_rq() instead of every time a request is prepared. Note: moving the tag initialization into scsi_initialize_rq() is not possible because the single-queue block layer only assigns a tag to a request after a request has been started.

Re: [PATCH] csiostor: Avoid content leaks and casts

2017-05-23 Thread Martin K. Petersen
Kees, > When copying attributes, the len argument was padded out and the > resulting memcpy() would copy beyond the end of the source buffer. > Avoid this, and use size_t for val_len to avoid all the > casts. Similarly, avoid source buffer casts and use void *. > > Additionally enforces val_len

Re: [PATCH] scsi: smartpqi: mark PM functions as __maybe_unused

2017-05-23 Thread Martin K. Petersen
Arnd, > The newly added suspend/resume support causes harmless warnings when > CONFIG_PM is disabled: > We can avoid the warnings by removing the #ifdef around the handlers > and instead marking them as __maybe_unused, which will let gcc drop > the unused code silently. Applied to

Re: [PATCH 1/2] scsi: nsp32: add __printf attribute to logging functions

2017-05-23 Thread Martin K. Petersen
Joe, > On Sat, 2017-05-20 at 13:16 +0200, Nicolas Iooss wrote: >> nsp32_message() and nsp32_dmessage() use printf format strings in order >> to format a message. Adding __printf attributes helps to detect errors >> in such format strings at build time, like: > Does anyone actually have or use

Re: [PATCH] scsi: hisi_sas: add null check before indirect pointer dereference

2017-05-23 Thread Martin K. Petersen
Gustavo A., > Add null check before indirectly dereferencing pointer task->lldd_task > in statement u32 tag = slot->idx; Applied to 4.13/scsi-queue. Thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH] qla2xxx: Remove an unused structure member

2017-05-23 Thread Martin K. Petersen
Bart, > qla_tgt_cmd.free_work is not used by the qla2xxx driver. Hence remove > that member of struct qla_tgt_cmd. Applied to 4.13/scsi-queue. Thanks, Bart! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH] qla2xxx: don't disable a not previously enabled PCI device

2017-05-23 Thread Martin K. Petersen
Johannes, > When pci_enable_device() or pci_enable_device_mem() fail in > qla2x00_probe_one() we bail out but do a call to > pci_disable_device(). This causes the dev_WARN_ON() in > pci_disable_device() to trigger, as the device wasn't enabled > previously. > > So instead of taking the

Re: [PATCH] lpfc: nvmet_fc: fix format string

2017-05-23 Thread Martin K. Petersen
Arnd, > The lpfc_nvmeio_data() tracing helper always takes a format string and > three additional arguments. The latest caller has a format string with > only two integer arguments, causing this harmless warning: James? -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH 00/31] SCSI patches for kernel v4.13.

2017-05-23 Thread Jens Axboe
On 05/23/2017 06:33 PM, Bart Van Assche wrote: > Hello Martin, > > This patch series consists of the bug fixes I came up with during > the past two months. Please consider these patches for kernel v4.13. Ehm, last I checked the block patches hadn't been reviewed/signed-off by anyone else. We

Re: [PATCH v2] Use ctlr directly in rdac_failover_get()

2017-05-23 Thread Martin K. Petersen
Artem, > rdac_failover_get references struct rdac_controller as > ctlr->ms_sdev->handler_data->ctlr for no apparent reason. Besides being > inefficient this also introduces a null-pointer dereference as > send_mode_select() sets ctlr->ms_sdev to NULL before calling > rdac_failover_get():

Re: [PATCH 00/25] qla2xxx: Bug fixes and cleanups

2017-05-23 Thread Martin K. Petersen
Himanshu, > This series contains bug fixes and cleanups for the driver that we > posted in 4.11. In that case, please tag the fixes patches with: Cc: # 4.11+ > Patches 1-10 needs to go in 4.12.0-rcX. Rest of the patches can be > queued to for-next branch. Please let

Re: [PATCH 00/15] qedf: Update driver to version 8.18.22.0.

2017-05-23 Thread Martin K. Petersen
Chad, > Please apply the following patches to the scsi tree at your earliest > convenience. Reviewers wanted! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH] scsi: libcxgbi: fix skb use after free

2017-05-23 Thread Martin K. Petersen
Varun, > skb->data is assigned to task->hdr in cxgbi_conn_alloc_pdu(), > skb gets freed after tx but task->hdr is still dereferenced in > iscsi_tcp_task_xmit() to avoid this call skb_get() after allocating > skb and free the skb in cxgbi_cleanup_task() or before allocating new > skb in

Re: [PATCH 0/7]qedi: Bug fixes.

2017-05-23 Thread Martin K. Petersen
Manish, > Please apply this patch set to next 'scsi-fixes' series. Applied to 4.12/scsi-fixes. Thank you! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH 00/31] SCSI patches for kernel v4.13.

2017-05-23 Thread Martin K. Petersen
Bart, > This patch series consists of the bug fixes I came up with during the > past two months. Please consider these patches for kernel v4.13. I'll have some time tomorrow to go through these. It would be nice is somebody else would step up to review as well. -- Martin K. Petersen

Re: Need help with handling failed ATA pass-through command and sense data

2017-05-23 Thread mail1
Sorry, I don't have the experience to do this quickly. I'm out of practice building a kernel and will need time to re-learn a few things. Can you please update the bug report and ask for someone else to try it? In the mean time, I'll do what I can. --GeekGirl1 On 05/23/2017 02:34 PM, Alan

Re: [PATCH] target: remove dead code

2017-05-23 Thread Nicholas A. Bellinger
On Thu, 2017-05-11 at 13:39 -0700, Tyrel Datwyler wrote: > On 05/09/2017 02:46 PM, Gustavo A. R. Silva wrote: > > Local variable _ret_ is assigned to a constant value and it is never > > updated again. Remove this variable and the dead code it guards. > > > > Addresses-Coverity-ID: 140761 > >

Re: [PATCH] ibmvscsis: Enable Logical Partition Migration Support

2017-05-23 Thread Nicholas A. Bellinger
On Tue, 2017-05-16 at 17:49 -0500, Bryant G. Ly wrote: > From: Michael Cyr > > Changes to support a new mechanism from phyp to better synchronize the > logical partition migration (LPM) of the client partition. > This includes a new VIOCTL to register that we support this new

Re: [PATCH 02/31] Create two versions of scsi_internal_device_unblock()

2017-05-23 Thread Hannes Reinecke
On 05/24/2017 02:33 AM, Bart Van Assche wrote: > This will make it easier to serialize SCSI device state changes > through a mutex. > > Signed-off-by: Bart Van Assche > Cc: Christoph Hellwig > Cc: Hannes Reinecke > Cc: Johannes Thumshirn

Re: [PATCH 01/31] Split scsi_internal_device_block()

2017-05-23 Thread Hannes Reinecke
On 05/24/2017 02:33 AM, Bart Van Assche wrote: > Instead of passing a "wait" argument to scsi_internal_device_block(), > split this function into a function that waits and a function that > doesn't wait. This will make it easier to serialize SCSI device state > changes through a mutex. > >

Re: [PATCH 08/31] sd, sr: Convert two assignments into warning statements

2017-05-23 Thread Hannes Reinecke
On 05/24/2017 02:33 AM, Bart Van Assche wrote: > Before scsi_prep_fn() calls the ULP .init_command() callback > function it stores the SCSI command pointer in request.special. > This means that the SCpnt = rq->special assignments in the sd > and sr drivers assign a pointer to itself. Hence convert

Re: [PATCH 07/31] scsi: Use blk_mq_rq_to_pdu() to convert a request to a SCSI command pointer

2017-05-23 Thread Hannes Reinecke
On 05/24/2017 02:33 AM, Bart Van Assche wrote: > Since commit e9c787e65c0c ("scsi: allocate scsi_cmnd structures as > part of struct request") struct request and struct scsi_cmnd are > adjacent. This means that there is now an alternative to reading > req->special to convert a pointer to a

Re: [PATCH 06/31] scmd_eh_abort_handler(): Add a comment

2017-05-23 Thread Hannes Reinecke
On 05/24/2017 02:33 AM, Bart Van Assche wrote: > After the patch that introduced this function was posted on the > linux-scsi mailing list an explanation was posted why this patch > is correct. Since that explanation contains important information, > add a summary of it above the code that

Re: [PATCH 05/31] Make __scsi_remove_device go straight from BLOCKED to DEL

2017-05-23 Thread Hannes Reinecke
On 05/24/2017 02:33 AM, Bart Van Assche wrote: > If a device is blocked, make __scsi_remove_device() cause it to > transition to the DEL state. This means that all the commands > issued in .shutdown() will error in the mid-layer, thus making > the removal proceed without being stopped. > > This

Re: [PATCH 10/31] Avoid that scsi_exit_rq() triggers a use-after-free

2017-05-23 Thread Hannes Reinecke
On 05/24/2017 02:33 AM, Bart Van Assche wrote: > Dereferencing shost from scsi_exit_rq() is not safe because the > SCSI host may already have been freed when scsi_exit_rq() is > called. Increasing the shost reference count in scsi_init_rq() > and dropping that reference in scsi_exit_rq() is

Re: [PATCH 00/31] SCSI patches for kernel v4.13.

2017-05-23 Thread Bart Van Assche
On Tue, 2017-05-23 at 21:55 -0600, Jens Axboe wrote: > On 05/23/2017 06:33 PM, Bart Van Assche wrote: > > Hello Martin, > > > > This patch series consists of the bug fixes I came up with during > > the past two months. Please consider these patches for kernel v4.13. > > Ehm, last I checked the

Re: [PATCH 03/31] Protect SCSI device state changes with a mutex

2017-05-23 Thread Hannes Reinecke
On 05/24/2017 02:33 AM, Bart Van Assche wrote: > Enable this mechanism for all scsi_target_*block() callers but not > for the scsi_internal_device_unblock() calls from the mpt3sas driver > because that driver can call scsi_internal_device_unblock() from > atomic context. > > Signed-off-by: Bart

Re: [PATCH 04/31] Introduce scsi_start_queue()

2017-05-23 Thread Hannes Reinecke
On 05/24/2017 02:33 AM, Bart Van Assche wrote: > This patch does not change any functionality. > > Signed-off-by: Bart Van Assche > Cc: Israel Rukshin > Cc: Max Gurtovoy > Cc: Hannes Reinecke > Cc: Benjamin

Re: [PATCH 09/31] block: Avoid that blk_exit_rl() triggers a use-after-free

2017-05-23 Thread Hannes Reinecke
On 05/24/2017 02:33 AM, Bart Van Assche wrote: > Since the introduction of the .init_rq_fn() and .exit_rq_fn() it > is essential that the memory allocated for struct request_queue > stays around until all blk_exit_rl() calls have finished. Hence > make blk_init_rl() take a reference on struct

Re: [PATCH] csiostor: Avoid content leaks and casts

2017-05-23 Thread Varun Prakash
On Mon, May 22, 2017 at 09:29:41AM -0700, Kees Cook wrote: > On Mon, May 22, 2017 at 8:05 AM, Varun Prakash wrote: > > On Tue, May 09, 2017 at 03:34:44PM -0700, Kees Cook wrote: > >> When copying attributes, the len argument was padded out and the resulting > >> memcpy() would

Re: [PATCH v9 06/15] mlx5: Replace PCI pool old API

2017-05-23 Thread Leon Romanovsky
On Tue, May 23, 2017 at 10:53:36AM +0200, Romain Perier wrote: > Hello, > > > Le 23/05/2017 à 09:27, Leon Romanovsky a écrit : > > On Mon, May 22, 2017 at 06:48:58PM +0200, Romain Perier wrote: > >> The PCI pool API is deprecated. This commit replaces the PCI pool old > >> API by the appropriate

Re: [PATCH] scsi: hisi_sas: add null check before indirect pointer dereference

2017-05-23 Thread John Garry
On 22/05/2017 19:00, Gustavo A. R. Silva wrote: Add null check before indirectly dereferencing pointer task->lldd_task in statement u32 tag = slot->idx; I don't think that this is a valid scenario, but protecting against a possible NULL dereference is prudent. Thanks