[PATCH v2] Use ctlr directly in rdac_failover_get()

2017-05-20 Thread Artem Savkov
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(): [ 18.432550]

[PATCH 2/2] libsas: Enhance libsas hotplug

2017-05-20 Thread Yijing Wang
Libsas complete a hotplug event notified by LLDD in several works, for example, if libsas receive a PHYE_LOSS_OF_SIGNAL, we process it in following steps: notify_phy_event[interrupt context] sas_queue_event [queue work on shost->work_q]

RE: work queue of scsi fc transports should be serialized

2017-05-20 Thread Dashi DS1 Cao
On Fri, 2017-05-19 at 09:36 +, Dashi DS1 Cao wrote: > It seems there is a race of multiple "fc_starget_delete" of the same > rport, thus of the same SCSI host. The race leads to the race of > scsi_remove_target and it cannot be prevented by the code snippet > alone, even of the most recent

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

2017-05-20 Thread Joe Perches
On Fri, 2017-05-19 at 10:04 +0200, Arnd Bergmann wrote: > The lpfc_nvmeio_data() tracing helper always takes a format string and > three additional arguments. No it doesn't. It takes a format and arguments. I don't disagree with the patch, just the characterization of the lpfc_mvmeio_data call

[PATCH 2/2] pcmcia: nsp_cs: add __printf attribute to logging functions

2017-05-20 Thread Nicolas Iooss
Adding __printf attributes helps to detect errors in printf format strings at build time. Signed-off-by: Nicolas Iooss --- drivers/scsi/pcmcia/nsp_cs.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/pcmcia/nsp_cs.c

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

2017-05-20 Thread Nicolas Iooss
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: drivers/scsi/nsp32.c:3314:23: error: format '%ld' expects argument of type 'long int', but argument 6

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

2017-05-20 Thread Yijing Wang
Now libsas hotplug work is static, LLDD driver queue the hotplug work into shost->work_q. If LLDD driver burst post lots hotplug events to libsas, the hotplug events may pending in the workqueue like shost->work_q new work[PORTE_BYTES_DMAED] --> |[PHYE_LOSS_OF_SIGNAL][PORTE_BYTES_DMAED] ->

[PATCH 0/2] Enhance libsas hotplug feature

2017-05-20 Thread Yijing Wang
Now the libsas hotplug has some issues, Dan Williams report a similar bug here before https://www.mail-archive.com/linux-scsi@vger.kernel.org/msg39187.html The issues we have found 1. if LLDD burst reports lots of phy-up/phy-down sas events, some events may lost because a same sas events is

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

2017-05-20 Thread Joe Perches
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: > > drivers/scsi/nsp32.c:3314:23: error:

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

2017-05-20 Thread Dan Williams
On Fri, May 19, 2017 at 11:39 PM, Yijing Wang wrote: > Now libsas hotplug work is static, LLDD driver queue > the hotplug work into shost->work_q. If LLDD driver > burst post lots hotplug events to libsas, the hotplug > events may pending in the workqueue like > >

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

2017-05-20 Thread Joe Perches
On Sat, 2017-05-20 at 21:10 +0200, Arnd Bergmann wrote: > On Sat, May 20, 2017 at 12:28 PM, Joe Perches wrote: > > On Fri, 2017-05-19 at 10:04 +0200, Arnd Bergmann wrote: > > > The lpfc_nvmeio_data() tracing helper always takes a format string and > > > three additional

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

2017-05-20 Thread Arnd Bergmann
On Sat, May 20, 2017 at 12:28 PM, Joe Perches wrote: > On Fri, 2017-05-19 at 10:04 +0200, Arnd Bergmann wrote: >> The lpfc_nvmeio_data() tracing helper always takes a format string and >> three additional arguments. > > No it doesn't. It takes a format and arguments. > > I