Re: [PATCH v2] Use blist_flags_t consistently

2017-12-11 Thread Christoph Hellwig
On Mon, Dec 11, 2017 at 04:08:03PM -0800, Bart Van Assche wrote: > + if (!((__force unsigned int)sdev->sdev_bflags & BIT(i))) I'd case the right side argument to __force blist_flags_t here for purely esthetic reasons. Except for that this looks fine to me: Reviewed-by: Christoph

Re: [PATCH] scsi_dh_alua: skip RTPG for devices only supporting active/optimized

2017-12-11 Thread Hannes Reinecke
On 12/12/2017 01:00 AM, Bart Van Assche wrote: > On Fri, 2017-12-08 at 11:14 +0100, Hannes Reinecke wrote: >> @@ -541,6 +544,20 @@ static int alua_rtpg(struct scsi_device *sdev, struct >> alua_port_group *pg) >> retval = submit_rtpg(sdev, buff, bufflen, _hdr, pg->flags); >> >> if

Re: [PATCH] NCR5380: Fix a possible sleep-in-atomic bug in NCR5380_poll_politely2

2017-12-11 Thread Jia-Ju Bai
Thanks for your reply :) On 2017/12/12 11:38, Finn Thain wrote: On Tue, 12 Dec 2017, Jia-Ju Bai wrote: From: Jia-Ju Bai The kernel module may sleep under a spinlock. The spinlock is always taken in irq mode, and the schedule_timeout_uninterruptible() is conditional

Re: [PATCH] NCR5380: Fix a possible sleep-in-atomic bug in NCR5380_poll_politely2

2017-12-11 Thread Finn Thain
On Tue, 12 Dec 2017, Jia-Ju Bai wrote: > From: Jia-Ju Bai > > The kernel module may sleep under a spinlock. The spinlock is always taken in irq mode, and the schedule_timeout_uninterruptible() is conditional on !irqs_disabled(). > The function call paths are: >

Re: [PATCH v2 1/3] scsi: Fix a scsi_show_rq() NULL pointer dereference

2017-12-11 Thread Ming Lei
On Mon, Dec 11, 2017 at 10:11:29PM -0500, Martin K. Petersen wrote: > > Hi Ming, > > > This patch allocates one array for T10_PI_TYPE2_PROTECTION command, > > size of each element is SD_EXT_CDB_SIZE, and the length is > > host->can_queue, then we can retrieve one command buffer runtime > > via

Re: [PATCH v2 1/3] scsi: Fix a scsi_show_rq() NULL pointer dereference

2017-12-11 Thread Martin K. Petersen
Hi Ming, > This patch allocates one array for T10_PI_TYPE2_PROTECTION command, > size of each element is SD_EXT_CDB_SIZE, and the length is > host->can_queue, then we can retrieve one command buffer runtime > via rq->tag. > > So we can avoid to allocate the command buffer runtime, also the >

[BUG] drivers/scsi/wd719x: a possible sleep-in-atomic bug in wd719x_host_reset

2017-12-11 Thread Jia-Ju Bai
According to drivers/scsi/wd719x.c, the kernel module may sleep under a spinlock. The function call path is: wd719x_host_reset (acquire the spinlock) wd719x_chip_init request_firmware --> may sleep I do not find a good way to fix it, so I only report. This possible bug is found by my

[BUG] drivers/scsi/ipr: two possible sleep-in-atomic bugs

2017-12-11 Thread Jia-Ju Bai
According to drivers/scsi/ipr.c, the kernel module may sleep under a spinlock. The function call paths are: ipr_shutdown (acquire the spinlock) irq_poll_disable msleep --> may sleep ipr_ata_post_internal (acquire the spinlock) ipr_device_reset ipr_send_blocking_cmd

Re: [PATCH 18/45] drivers: scsi: qla2xxx: remove duplicate includes

2017-12-11 Thread Martin K. Petersen
Pravin, > These duplicate includes have been found with scripts/checkincludes.pl but > they have been removed manually to avoid removing false positives. Applied to 4.16/scsi-queue. Thank you! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH] qla2xxx: Suppress gcc 7 fall-through warnings

2017-12-11 Thread Martin K. Petersen
Bart, > Avoid that building with gcc 7 and W=1 triggers warnings similar > to the following: /scsi/qla2xxx/qla_isr.c:1189:27: warning: this statement may fall through [-Wimplicit-fallthrough=] Applied to 4.16/scsi-queue. Thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH v2 1/3] scsi: Fix a scsi_show_rq() NULL pointer dereference

2017-12-11 Thread Martin K. Petersen
Bart, > Avoid that scsi_show_rq() triggers a NULL pointer dereference if > called after sd_uninit_command(). Swap the NULL pointer assignment > and the mempool_free() call in sd_uninit_command() to make it less > likely that scsi_show_rq() triggers a use-after-free. Note: even > with these

[PATCH] NCR5380: Fix a possible sleep-in-atomic bug in NCR5380_poll_politely2

2017-12-11 Thread Jia-Ju Bai
From: Jia-Ju Bai The kernel module may sleep under a spinlock. The function call paths are: NCR5380_select (acquire the spinlock) NCR5380_reselect NCR5380_poll_politely NCR5380_poll_politely2 schedule_timeout_uninterruptible --> may sleep

Re: [PATCH] MAINTIANERS: change FCoE list to linux-scsi

2017-12-11 Thread Martin K. Petersen
Johannes, > fcoe-de...@open-fcoe.org is defunct and all patches are routed via the > SCSI tree anyways. Applied to 4.15/scsi-fixes. Thank yo! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH v3] scsi: libsas: fix length error in sas_smp_handler()

2017-12-11 Thread Martin K. Petersen
Jason, > The return value of smp_execute_task_sg() is the untransferred > residual, but bsg_job_done() requires the length of payload > received. This makes SMP passthrough commands from userland by sg > ioctl to libsas get a wrong response. The userland tools such as > smp_utils failed becuase

Re: [PATCH] documentation: add scsi_common.c to SCSI driver-api

2017-12-11 Thread Martin K. Petersen
Randy, > Add exported functions from scsi_common.c to the SCSI driver API > documentation. Applied to 4.16/scsi-queue, thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH 1/1] scsi: fnic: add a space after %p in printf format

2017-12-11 Thread Martin K. Petersen
Nicolas, > fnic_fcpio_icmnd_cmpl_handler() displays the value of sc with: > As the literal strings get merged, the function uses %ps instead of the > intended raw %p format. Fix this by inserting a space. Applied to 4.16/scsi-queue. Thank you! -- Martin K. Petersen Oracle Linux

Re: [PATCH] scsi: doc. fixes to scsi_common.c

2017-12-11 Thread Martin K. Petersen
Randy, > Clean up some comment typos and fix some errors in documentation. Applied to 4.16/scsi-queue. Thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH][next] scsi: arcmsr: remove redundant check for secs < 0

2017-12-11 Thread Martin K. Petersen
Colin, > The check for secs being less than zero is redundant for two reasons. > Firstly, secs is unsigned so the check is always going to be false. > Secondly, if secs was signed the proceeding calculation of secs is > never going to be negative. Hence we can remove this redundant check > and

Re: [PATCH] scsi: bfa: convert to strlcpy/strlcat

2017-12-11 Thread Martin K. Petersen
Arnd, > The bfa driver has a number of real issues with string termination > that gcc-8 now points out: Applied to 4.16/scsi-queue. Thank you! -- Martin K. Petersen Oracle Linux Engineering

[BUG] drivers/scsi/dpt_i2o: a possible sleep-in-atomic bug in adpt_i2o_status_get

2017-12-11 Thread Jia-Ju Bai
According to drivers/scsi/dpt_i2o.c, the kernel module may sleep under a spinlock. The function call paths are: adpt_reset (acquire the spinlock) __adpt_reset adpt_hba_reset adpt_i2o_activate_hba adpt_i2o_status_get dma_alloc_coherent(GFP_KERNEL) --> may sleep

[BUG] drivers/scsi/dpt_i2o: a possible sleep-in-atomic bug in adpt_i2o_post_this

2017-12-11 Thread Jia-Ju Bai
According to drivers/scsi/dpt_i2o.c, the kernel module may sleep under a spinlock. The function call paths are: adpt_abort (acquire the spinlock) adpt_i2o_post_wait adpt_i2o_post_this schedule_timeout_uninterruptible--> may sleep adpt_device_reset (acquire the spinlock)

[BUG] drivers/scsi/dpt_i2o: a possible sleep-in-atomic bug in adpt_isr

2017-12-11 Thread Jia-Ju Bai
According to drivers/scsi/dpt_i2o.c, the kernel module may sleep in the interrupt handler. The function call path is: adpt_isr (interrupt handler) adpt_send_nop schedule_timeout_uninterruptible --> may sleep A possible fixing is to replace "schedule_timeout_uninterruptible" with

[BUG] drivers/scsi/advansys: three possible sleep-in-atomic bugs in advansys_interrupt

2017-12-11 Thread Jia-Ju Bai
According to drivers/scsi/advansys.c, the kernel module may sleep in the interrupt handler. The function call paths are: advansys_interrupt (interrupt handler) AdvISR adv_async_callback AdvResetChipAndSB AdvInitAsc38C1600Driver request_firmware --> may sleep

Re: [PATCH V8 0/7] blk-mq support for ZBC disks

2017-12-11 Thread Damien Le Moal
Jens, On Fri, 2017-11-24 at 16:54 -0700, Jens Axboe wrote: > On 11/24/2017 04:48 PM, Damien Le Moal wrote: > > [Full quote deleted] > > > > Hi Jens, > > > > Any comment regarding this series ? > > I understand that this would be for the 4.16 merge window, so no hurry, > > but I would like to

[PATCH 4/4] scsi_debug: add resp_write_scat function

2017-12-11 Thread Douglas Gilbert
Add resp_write_scat() function to support decoding WRITE SCATTERED (16 and 32). Also weave resp_write_scat() into the cdb decoding logic. Split SDEB_I_SERV_ACT_IN into 12 and 16 byte variants (similarly for SERV_ACT_OUT). As yet the driver doesn't need either of the 12 byte variants.

[PATCH 1/4] scsi_debug: tab, kstrto changes, requested by checkpatch.pl

2017-12-11 Thread Douglas Gilbert
Some of my development tools tend to add spaces (my preference) rather than tabs (kernel convention). Running unexpand to clean these spaces up found more of them than checkpatch.pl did. Then checkpatch.pl complained about other style violations in those newly tabbed lines. Signed-off-by: Douglas

[PATCH 0/4] scsi_debug: add write scattered support

2017-12-11 Thread Douglas Gilbert
While testing the WRITE SCATTERED command support in a new sg3_utils utility (sg_write_x) it was helpful to have a target that supported this command. This command might be attractive to other kernel subsystems. Even if end devices don't support this command yet, it would most likely be a

[PATCH 3/4] scsi_debug: expand do_device_access to take sg offset

2017-12-11 Thread Douglas Gilbert
WRITE SCATTERED needs to take several "bites" out of the data-out buffer. Expand the do_device_access() function to take a sg_skip argument. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-)

[PATCH 2/4] scsi_debug: fix group_number mask 0x1f->0x3f

2017-12-11 Thread Douglas Gilbert
Various cdb masks incorrectly assumed the GROUP NUMBER field was 5 bits long. It is actually 6 bits long. Correct. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git

Re: [PATCH] sd: Increase SCSI disk probing concurrency

2017-12-11 Thread Bart Van Assche
On Sun, 2017-12-10 at 15:44 +0100, Hannes Reinecke wrote: > You know what, I have been working on a similar patch for quite some > time now; [ ... ] That's very interesting :-) > However, in doing so I have encountered several issues which have been > exposed by that; the most trivial one being

[PATCH v2] Use blist_flags_t consistently

2017-12-11 Thread Bart Van Assche
Use the type blist_flags_t for all variables that represent blacklist flags. Additionally, suppress recently introduced sparse warnings related to blacklist flags. Fixes: commit c6b54164508a ("scsi: Use 'blist_flags_t' for scsi_devinfo flags") Signed-off-by: Bart Van Assche

Re: [PATCH] scsi_dh_alua: skip RTPG for devices only supporting active/optimized

2017-12-11 Thread Bart Van Assche
On Fri, 2017-12-08 at 11:14 +0100, Hannes Reinecke wrote: > @@ -541,6 +544,20 @@ static int alua_rtpg(struct scsi_device *sdev, struct > alua_port_group *pg) > retval = submit_rtpg(sdev, buff, bufflen, _hdr, pg->flags); > > if (retval) { > + /* > + * If the

Re: [PATCH 1/1] scsi: fnic: add a space after %p in printf format

2017-12-11 Thread Bart Van Assche
On Mon, 2017-12-11 at 23:54 +0100, Nicolas Iooss wrote: > On Mon, Dec 11, 2017 at 11:22 PM, Bart Van Assche > wrote: > > On Sun, 2017-12-10 at 20:23 +0100, Nicolas Iooss wrote: > > > - "hdr status = %s tag = 0x%x sc = 0x%p" > > > +

Re: [PATCH 1/1] scsi: fnic: add a space after %p in printf format

2017-12-11 Thread Nicolas Iooss
On Mon, Dec 11, 2017 at 11:22 PM, Bart Van Assche wrote: > > On Sun, 2017-12-10 at 20:23 +0100, Nicolas Iooss wrote: > > fnic_fcpio_icmnd_cmpl_handler() displays the value of sc with: > > > > FNIC_SCSI_DBG(KERN_INFO... > > "... sc = 0x%p" > >

Re: [PATCH] scsi: doc. fixes to scsi_common.c

2017-12-11 Thread Bart Van Assche
On Sun, 2017-12-10 at 10:11 -0800, Randy Dunlap wrote: > Clean up some comment typos and fix some errors in documentation. Reviewed-by: Bart Van Assche

Re: [PATCH 1/1] scsi: fnic: add a space after %p in printf format

2017-12-11 Thread Bart Van Assche
On Sun, 2017-12-10 at 20:23 +0100, Nicolas Iooss wrote: > fnic_fcpio_icmnd_cmpl_handler() displays the value of sc with: > > FNIC_SCSI_DBG(KERN_INFO... > "... sc = 0x%p" > "scsi_status ..." > ... > > As the literal strings get merged, the function uses %ps instead of

Re: linux-next: build failure after merge of the scsi-mkp tree

2017-12-11 Thread Paul E. McKenney
On Thu, Dec 07, 2017 at 08:00:50PM -0500, Martin K. Petersen wrote: > > > I'm perfectly OK with taking it through the SCSI tree. Probably the > > path of least resistance. > > Applied to 4.16/scsi-queue and rebased so it sits before Bart's patch. Thank you! I have removed this patch from -rcu.

Re: [PATCH] MAINTIANERS: change FCoE list to linux-scsi

2017-12-11 Thread Bart Van Assche
On Mon, 2017-12-11 at 10:09 +0100, Johannes Thumshirn wrote: > fcoe-de...@open-fcoe.org is defunct and all patches are routed via the SCSI > tree anyways. > > So update MAINTAINERS accordingly. Please check the spelling of "MAINTAINERS" in the subject. Anyway: Reviewed-by: Bart Van Assche

[PATCH 6/6] target: tcm_loop: Use seq_puts() in tcm_loop_show_info()

2017-12-11 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 11 Dec 2017 11:01:57 +0100 The script "checkpatch.pl" pointed information out like the following. WARNING: Prefer seq_puts to seq_printf Thus fix the affected source code place. Signed-off-by: Markus Elfring

[PATCH 5/6] target: tcm_loop: Delete an unnecessary return statement in tcm_loop_submission_work()

2017-12-11 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 11 Dec 2017 10:58:33 +0100 The script "checkpatch.pl" pointed information out like the following. WARNING: void function return statements are not generally useful Thus remove such a statement in the affected function.

[PATCH 4/6] target: tcm_loop: Delete two unnecessary variable initialisations in tcm_loop_issue_tmr()

2017-12-11 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 11 Dec 2017 10:56:42 +0100 The variables "se_cmd" and "tl_cmd" will eventually be set to appropriate pointers a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring

[PATCH 3/6] target: tcm_loop: Combine substrings for 26 messages

2017-12-11 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 11 Dec 2017 10:40:23 +0100 The script "checkpatch.pl" pointed information out like the following. WARNING: quoted string split across lines Thus fix the affected source code places. Signed-off-by: Markus Elfring

[PATCH 2/6] target: tcm_loop: Improve a size determination in two functions

2017-12-11 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 10 Dec 2017 21:23:43 +0100 Replace the specification of data structures by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style

[PATCH 1/6] target: tcm_loop: Delete an error message for a failed memory allocation in four functions

2017-12-11 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 10 Dec 2017 21:18:15 +0100 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

[PATCH 0/6] target/loopback/tcm: Adjustments for some function implementations

2017-12-11 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 11 Dec 2017 11:33:44 +0100 Some update suggestions were taken into account from static source code analysis. Markus Elfring (6): Delete an error message for a failed memory allocation in four functions Improve a size

[PATCH] MAINTIANERS: change FCoE list to linux-scsi

2017-12-11 Thread Johannes Thumshirn
fcoe-de...@open-fcoe.org is defunct and all patches are routed via the SCSI tree anyways. So update MAINTAINERS accordingly. Signed-off-by: Johannes Thumshirn --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index