Re: [BUG] scsi/qla2xxx: a possible sleep-in-atomic bug in qlt_get_tag

2017-12-12 Thread Jia-Ju Bai
On 2017/12/13 12:42, James Bottomley wrote: On Wed, 2017-12-13 at 11:18 +0800, Jia-Ju Bai wrote: The driver may sleep under a spinlock. The function call paths are: qlt_handle_abts_recv_work (acquire the spinlock) qlt_response_pkt_all_vps qlt_response_pkt

Re: [PATCH 1/4] block: check for GENHD_FL_UP in del_gendisk()

2017-12-12 Thread Hannes Reinecke
On 12/12/2017 05:57 PM, Bart Van Assche wrote: > On Tue, 2017-12-12 at 09:57 +0100, Hannes Reinecke wrote: >> From: Hannes Reinecke >> >> When a device is probed asynchronously del_gendisk() might be called >> before the async probing was run, causing del_gendisk() to crash >> due

Re: [BUG] scsi/qla2xxx: a possible sleep-in-atomic bug in qlt_get_tag

2017-12-12 Thread James Bottomley
On Wed, 2017-12-13 at 11:18 +0800, Jia-Ju Bai wrote: > The driver may sleep under a spinlock. > The function call paths are: > qlt_handle_abts_recv_work (acquire the spinlock) >    qlt_response_pkt_all_vps >  qlt_response_pkt >    qlt_handle_cmd_for_atio >  qlt_get_tag >    

[BUG] scsi/qla2xxx: a possible sleep-in-atomic bug in qlt_get_tag

2017-12-12 Thread Jia-Ju Bai
The driver may sleep under a spinlock. The function call paths are: qlt_handle_abts_recv_work (acquire the spinlock) qlt_response_pkt_all_vps qlt_response_pkt qlt_handle_cmd_for_atio qlt_get_tag percpu_ida_alloc --> may sleep qla82xx_msix_rsp_q (acquire the

[PATCH] scsi: mpt3sas: validate device handle before ata pending flag

2017-12-12 Thread Yuanyuan Zhong
Commit ffb584565894 ("scsi: mpt3sas: fix hang on ata passthrough commands") introduced ata_command_pending bit-flag to ensure sending only one outstanding pass through ATA command to target device. However if target device become irresponsive with ata_command_pending, we won't be able to remove

Re: [bug report] A race between device_resume and removing disk

2017-12-12 Thread chenxiang (M)
Ping...Does anyone has some idea about this issue? 在 2017/11/16 11:54, chenxiang (M) 写道: Hi all, When debugging suspend and resume of hisi_sas, I find a issue: use commands (echo freeze > /sys/power/state) to suspend, after 5s system will be resumed as i enable TEST_DEVICES. But if I

[PATCH 8/8] target/iscsi: Improve 16 size determinations

2017-12-12 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 12 Dec 2017 22:06:00 +0100 Replace the specification of data types 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 7/8] target/iscsi: Delete an unnecessary variable initialisation in iscsi_set_default_param()

2017-12-12 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 12 Dec 2017 21:21:31 +0100 The local variable "param" will be reassigned by a following statement. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring ---

[PATCH 6/8] target/iscsi: Delete an unnecessary variable initialisation in iscsi_create_default_params()

2017-12-12 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 12 Dec 2017 21:18:39 +0100 The variable "param" will eventually be set to an appropriate pointer a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring ---

[PATCH 5/8] target/iscsi: Delete an unnecessary variable initialisation in iscsi_copy_param_list()

2017-12-12 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 12 Dec 2017 21:15:55 +0100 The variable "param_list" will be reassigned by a following statement. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring ---

[PATCH 4/8] target/iscsi: Delete an unnecessary variable initialisation in iscsit_allocate_ooo_cmdsn()

2017-12-12 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 12 Dec 2017 21:13:49 +0100 The local variable "ooo_cmdsn" will be reassigned by a following statement. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring ---

[PATCH 3/8] target/iscsi: Delete 36 error messages for a failed memory allocation

2017-12-12 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 12 Dec 2017 21:07:16 +0100 Omit extra messages for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

[PATCH 2/8] target/iscsi: Move resetting of seven variables in chap_server_compute_md5()

2017-12-12 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 12 Dec 2017 19:43:47 +0100 Move the resetting of these array variables so that this operation will be performed only if memory allocations succeeded before in this function. Signed-off-by: Markus Elfring

[PATCH 1/8] target/iscsi: Less function calls in chap_server_compute_md5() after error detection

2017-12-12 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 12 Dec 2017 18:00:41 +0100 The functions "crypto_free_shash", "kfree" and "kzfree" were called in a few cases by the chap_server_compute_md5() function during error handling even if the passed variable contained a null pointer. *

[PATCH 0/8] target-iSCSI: Adjustments for several function implementations

2017-12-12 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 12 Dec 2017 22:22:11 +0100 Some update suggestions were taken into account from static source code analysis. Markus Elfring (8): Less function calls in chap_server_compute_md5() after error detection Move resetting of seven

Re: [PATCH 4/4] scsi_debug: add resp_write_scat function

2017-12-12 Thread Douglas Gilbert
On 2017-12-12 02:40 PM, Bart Van Assche wrote: On Mon, 2017-12-11 at 20:10 -0500, Douglas Gilbert wrote: -static const struct opcode_info_t vl_iarr[1] = { /* VARIABLE LENGTH */ +static const struct opcode_info_t vl_iarr[2] = { /* VARIABLE LENGTH */ Please leave out the array size

[PATCH] scsi: aacraid: fix io drop during the reset

2017-12-12 Thread Prasad B Munirathnam
"FIB_CONTEXT_FLAG_TIMEDOUT" flag is set in aac_eh_abort to indicate command timeout, using the same flag in reset handler causes the command to timeout and the IO's were droped. defined a new flag "FIB_CONTEXT_FLAG_EH_RESET" to make sure IO is properly handled in eh_reset handler. Signed-off-by:

Re: [PATCH 4/4] scsi_debug: add resp_write_scat function

2017-12-12 Thread Bart Van Assche
On Mon, 2017-12-11 at 20:10 -0500, Douglas Gilbert wrote: > -static const struct opcode_info_t vl_iarr[1] = { /* VARIABLE LENGTH */ > +static const struct opcode_info_t vl_iarr[2] = { /* VARIABLE LENGTH */ Please leave out the array size and let the compiler determine the array size. >

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

2017-12-12 Thread Bart Van Assche
On Mon, 2017-12-11 at 20:10 -0500, Douglas Gilbert wrote: > Various cdb masks incorrectly assumed the GROUP NUMBER field was > 5 bits long. It is actually 6 bits long. Correct. Reviewed-by: Bart Van Assche

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

2017-12-12 Thread Bart Van Assche
On Mon, 2017-12-11 at 20:10 -0500, Douglas Gilbert wrote: > 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. Reviewed-by: Bart Van Assche

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

2017-12-12 Thread Bart Van Assche
On Mon, 2017-12-11 at 20:10 -0500, Douglas Gilbert wrote: > 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

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

2017-12-12 Thread Bart Van Assche
On Tue, 2017-12-12 at 08:01 +0100, Hannes Reinecke wrote: > 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 =

[PATCH v3] Use blist_flags_t consistently

2017-12-12 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: [GIT PULL] SCSI fixes for 4.15-rc3

2017-12-12 Thread Martin K. Petersen
Linus, > The commit you point to _is_ the probnlem. It does: > > struct bfad_im_port_s *im_port = shost->hostdata[0]; > > which is utter bullshit crap. Sorry, wrong commit: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git/commit/?h=fixes=48d83282db077f93b2cf40de120f4d6f29eb293b

Re: [GIT PULL] SCSI fixes for 4.15-rc3

2017-12-12 Thread James Bottomley
On Tue, 2017-12-12 at 09:32 -0800, Linus Torvalds wrote: > On Tue, Dec 12, 2017 at 9:22 AM, Martin K. Petersen > wrote: > > > > > > Arnd and Johannes fixed this up right away: > > The commit you point to _is_ the probnlem. It does: > > struct bfad_im_port_s

Re: [GIT PULL] SCSI fixes for 4.15-rc3

2017-12-12 Thread Linus Torvalds
On Tue, Dec 12, 2017 at 9:22 AM, Martin K. Petersen wrote: > > Arnd and Johannes fixed this up right away: The commit you point to _is_ the probnlem. It does: struct bfad_im_port_s *im_port = shost->hostdata[0]; which is utter bullshit crap. Notice? It's

Re: [GIT PULL] SCSI fixes for 4.15-rc3

2017-12-12 Thread James Bottomley
On Tue, 2017-12-12 at 12:22 -0500, Martin K. Petersen wrote: > Linus, > > > > > This is utter shite, and doesn't even compile cleanly. > > > > Sure, it's "just" a warning, and the code works. But no, I'm not > > pulling crap like this. If you save a pointer in an integer > > "hostdata[0]"

Re: [GIT PULL] SCSI fixes for 4.15-rc3

2017-12-12 Thread Martin K. Petersen
Linus, > This is utter shite, and doesn't even compile cleanly. > > Sure, it's "just" a warning, and the code works. But no, I'm not > pulling crap like this. If you save a pointer in an integer > "hostdata[0]" field, then you damn well do the proper casts or helper > functions or something, you

Re: [GIT PULL] SCSI fixes for 4.15-rc3

2017-12-12 Thread Linus Torvalds
On Tue, Dec 12, 2017 at 8:21 AM, James Bottomley wrote: > > The most important one is the bfa fix because it's easy to oops the > kernel with this driver, a regression in the new timespec conversion in > aacraid and a regression in the Fibre Channel ELS

Re: [PATCH 1/4] block: check for GENHD_FL_UP in del_gendisk()

2017-12-12 Thread Bart Van Assche
On Tue, 2017-12-12 at 09:57 +0100, Hannes Reinecke wrote: > From: Hannes Reinecke > > When a device is probed asynchronously del_gendisk() might be called > before the async probing was run, causing del_gendisk() to crash > due to uninitialized sysfs objects. > > Signed-off-by:

Re: [PATCH v2] Use blist_flags_t consistently

2017-12-12 Thread Bart Van Assche
On Tue, 2017-12-12 at 08:52 +0100, Christoph Hellwig wrote: > 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

[GIT PULL] SCSI fixes for 4.15-rc3

2017-12-12 Thread James Bottomley
The most important one is the bfa fix because it's easy to oops the kernel with this driver, a regression in the new timespec conversion in aacraid and a regression in the Fibre Channel ELS handling patch.  The other three are a theoretical problem with termination in the vendor/host matching code

[PATCH] arcmsr: Fix possible sleep-in-atomic bugs in arcmsr_queue_command

2017-12-12 Thread Jia-Ju Bai
From: Jia-Ju Bai The driver may sleep under a spinlock, and the function call paths are: arcmsr_queue_command(acquire the spinlock) arcmsr_queue_command_lck arcmsr_handle_virtual_command arcmsr_iop_message_xfer arcmsr_iop_parking

[PATCH 2/2] target: cxgbit: Combine substrings for 11 messages

2017-12-12 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 12 Dec 2017 12:57:47 +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 1/2] target: cxgbit: Delete an error message for a failed memory allocation in two functions

2017-12-12 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 12 Dec 2017 11:34:51 +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/2] target/iscsi/cxgbit: Adjustments for seven function implementations

2017-12-12 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 12 Dec 2017 13:12:11 +0100 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete an error message for a failed memory allocation in two functions Combine substrings for 11

[PATCH 4/4] scsi: arcmsr: simplify all arcmsr_hbaX_get_config routine by call a new get_adapter_config function

2017-12-12 Thread Ching Huang
From: Ching Huang simplify all arcmsr_hbaX_get_config routine by call a new get_adapter_config function Signed-off-by: Ching Huang --- diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index b7a56e8..95c9f08

[PATCH 3/4] scsi: arcmsr: simplify arcmsr_hbaE_get_config function

2017-12-12 Thread Ching Huang
From: Ching Huang simplify arcmsr_hbaE_get_config function Signed-off-by: Ching Huang --- diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index dfaea8f..b7a56e8 100755 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++

[PATCH 2/4] scsi: arcmsr: waiting for iop firmware ready before issue get_config command to iop

2017-12-12 Thread Ching Huang
From: Ching Huang waiting for iop firmware ready before issue get_config command to iop for adapter type A and D Signed-off-by: Ching Huang --- diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index

[PATCH 1/4] scsi: arcmsr: simplify arcmsr_hbaC_get_config function

2017-12-12 Thread Ching Huang
From: Ching Huang simplify arcmsr_hbaC_get_config function Signed-off-by: Ching Huang --- diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index e4258b6..9b587ca 100755 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++

[PATCH 0/4] scsi: arcmsr: simplify hba_get_config routine

2017-12-12 Thread Ching Huang
From: Ching Huang These patches are apply to Martin's 4.16/scsi-queue. patch 1: simplify arcmsr_hbaC_get_config function. patch 2: wait iop firmware ready before issue get_config command to iop. patch 3: simplify arcmsr_hbaE_get_config function. patch 4: simplify all

[mainline] rcu stalls on CPU when unbinding mpt3sas driver

2017-12-12 Thread Abdul Haleem
Hi, Off late we are seeing cpu stalls messages while mpt3sas driver unbind on powerpc machine for both mainline and linux-next kernels Machine Type: Power 8 Bare-metal Kernel version: 4.15.0-rc2 config: attached. test: driver unbind $ echo -n 0001:03:00.0 > /sys/bus/pci/drivers/mpt3sas/unbind

[PATCH 4/4] sd: use async_probe cookie to avoid deadlocks

2017-12-12 Thread Hannes Reinecke
With the current design we're waiting for all async probes to finish when removing any sd device. This might lead to a livelock where the 'remove' call is blocking for any probe calls to finish, and the probe calls are waiting for a response, which will never be processes as the thread handling

[PATCH 3/4] scsi: add missing get_device() return value checks

2017-12-12 Thread Hannes Reinecke
We need to validate that get_device() succeeded, otherwise we'll end up working with invalid devices. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_scan.c | 14 -- drivers/scsi/sd.c| 8 +--- 2 files changed, 17 insertions(+), 5 deletions(-) diff

[PATCH 2/4] sd: Check if parent is still present before proceeding with probing

2017-12-12 Thread Hannes Reinecke
When a new SCSI disk is created we should be checking if the parent device is actually present before proceeding with probing. Signed-off-by: Hannes Reinecke --- drivers/scsi/sd.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/sd.c

[PATCH 0/4] sd async probing

2017-12-12 Thread Hannes Reinecke
Hi all, here's a patchset to facilitate full async scsi disk probing. The current approach has the problem of calling async_synchronize_full_domain() during sd_remove(), which is required to wait for _all_ current asynchronous probes to complete. When running under iSER sd_remove() is called from

[PATCH 1/4] block: check for GENHD_FL_UP in del_gendisk()

2017-12-12 Thread Hannes Reinecke
From: Hannes Reinecke When a device is probed asynchronously del_gendisk() might be called before the async probing was run, causing del_gendisk() to crash due to uninitialized sysfs objects. Signed-off-by: Hannes Reinecke --- block/genhd.c | 3 +++ 1 file

[PATCH] esas2r: Fix a possible sleep-in-atomic bug in esas2r_wait_request

2017-12-12 Thread Jia-Ju Bai
The driver may sleep in the interrupt handler. The function call path is: esas2r_adapter_tasklet (interrupt handler) esas2r_do_tasklet_tasks esas2r_handle_chip_rst_during_tasklet esas2r_init_adapter_hw esas2r_init_msgs esas2r_wait_request

[PATCH] esas2r: Fix a possible sleep-in-atomic bug in esas2r_flash_access

2017-12-12 Thread Jia-Ju Bai
The driver may sleep in the interrupt handler. The function call path is: esas2r_adapter_tasklet (interrupt handler) esas2r_do_tasklet_tasks esas2r_handle_chip_rst_during_tasklet esas2r_init_adapter_hw esas2r_nvram_read_direct esas2r_read_flash_block

[BUG] drivers/scsi/esas2r: a possible sleep-in-atomic bug in esas2r_nvram_read_direct

2017-12-12 Thread Jia-Ju Bai
The driver may sleep in the interrupt handler. The function call path is: esas2r_adapter_tasklet (interrupt handler) esas2r_do_tasklet_tasks esas2r_handle_chip_rst_during_tasklet esas2r_init_adapter_hw esas2r_nvram_read_direct down_interruptible --> may sleep I do

[PATCH] esas2r: Fix possible sleep-in-atomic bugs in esas2r_check_adapter

2017-12-12 Thread Jia-Ju Bai
The driver may sleep in the interrupt handler. The function call path is: esas2r_adapter_tasklet (interrupt handler) esas2r_do_tasklet_tasks esas2r_handle_chip_rst_during_tasklet esas2r_check_adapter schedule_timeout_interruptible To fix it, schedule_timeout_uninterruptible is

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

2017-12-12 Thread Hannes Reinecke
On 12/12/2017 01:16 AM, Bart Van Assche wrote: > 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