[PATCH 0/1] random vs blk-mq

2014-04-25 Thread Christoph Hellwig
A tester found out that we need add_disk_randomness for my scsi-mq branch. The patch applied exports add_disk_randomness so that modular scsi still works with a driver that either uses the low-level I/O completion routines for the old block layer, or blk-mq, and I'd love to get this in through

[PATCH 1/1] random: export add_disk_randomness

2014-04-25 Thread Christoph Hellwig
This will be needed for pending changes to the scsi midlayer that now calls lower level block APIs, as well as any blk-mq driver that wants to contribute to the random pool. Signed-off-by: Christoph Hellwig h...@lst.de --- drivers/char/random.c |1 + 1 file changed, 1 insertion(+) diff

[PATCH 1/2] scsi: don't reference freed command in scsi_init_sgtable

2014-04-25 Thread Christoph Hellwig
When scsi_init_io fails we have to release our device reference, but we do this trying to reference the just freed command. Add a local scsi_device pointer to fix this. Reported-by: Sander Eikelenboom li...@eikelenboom.it Signed-off-by: Christoph Hellwig h...@lst.de --- drivers/scsi/scsi_lib.c

[PATCH 2/2] scsi: don't reference freed command in scsi_prep_return

2014-04-25 Thread Christoph Hellwig
In the kill case of scsi_prep_return we have to release our device reference, but we do this trying to reference the just freed command. Use the local sdev pointer instead. Reported-by: Joe Lawrence joe.lawre...@stratus.com Signed-off-by: Christoph Hellwig h...@lst.de --- drivers/scsi/scsi_lib.c

two small scsi fixes for 3.15-rc3

2014-04-25 Thread Christoph Hellwig
Hi Linus, hi James, these are two simple use after free fixes that fix a regression introduced by me in the first scsi update for 3.15-rc1. I've sent them to the scsi list 10 days ago and haven't seen any reply to them, and I'd hate if they miss -rc3 in addition to -rc2. -- To unsubscribe from

Re: [PATCH] scsi: replace numeric messages with string error messages when blk_execute_rq fails. Also add printing of sense info.

2014-04-25 Thread Christoph Hellwig
On Tue, Apr 22, 2014 at 01:44:16PM +0200, Maurizio Lombardi wrote: Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/device_handler/scsi_dh_alua.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) Looks useful, but why do we have basically two

Re: [PATCH] ch: add refcounting

2014-04-25 Thread Christoph Hellwig
On Thu, Apr 10, 2014 at 04:12:57PM +0200, Hannes Reinecke wrote: On 04/10/2014 01:51 PM, Christoph Hellwig wrote: static int ch_release(struct inode *inode, struct file *file) { scsi_changer *ch = file-private_data; scsi_device_put(ch-device); + ch-device = NULL;

Re: [PATCH 1/1] random: export add_disk_randomness

2014-04-25 Thread Theodore Ts'o
On Fri, Apr 25, 2014 at 12:36:37AM -0700, Christoph Hellwig wrote: This will be needed for pending changes to the scsi midlayer that now calls lower level block APIs, as well as any blk-mq driver that wants to contribute to the random pool. Signed-off-by: Christoph Hellwig h...@lst.de

Re: [PATCH 0/1] random vs blk-mq

2014-04-25 Thread Theodore Ts'o
On Fri, Apr 25, 2014 at 12:36:10AM -0700, Christoph Hellwig wrote: But this also brings up an interesting question: blk-mq currently does not set QUEUE_FLAG_ADD_RANDOM in the default queue flags, so simply converting a driver to blk-mq will mean it stops contributing to the random pool. Do

Re: [PATCH 0/1] random vs blk-mq

2014-04-25 Thread Jens Axboe
On 04/25/2014 01:36 AM, Christoph Hellwig wrote: A tester found out that we need add_disk_randomness for my scsi-mq branch. The patch applied exports add_disk_randomness so that modular scsi still works with a driver that either uses the low-level I/O completion routines for the old block

Re: [PATCH 0/1] random vs blk-mq

2014-04-25 Thread Jens Axboe
On 04/25/2014 08:03 AM, Theodore Ts'o wrote: On Fri, Apr 25, 2014 at 12:36:10AM -0700, Christoph Hellwig wrote: But this also brings up an interesting question: blk-mq currently does not set QUEUE_FLAG_ADD_RANDOM in the default queue flags, so simply converting a driver to blk-mq will mean it

[GIT PULL] SCSI fixes for 3.15-rc3

2014-04-25 Thread James Bottomley
This is a set of seven fixes, three (hpsa) and free'd command references correcting bugs in the last round of updates and the remaining four correcting problems within the SCSI error handler that was causing a deadlock within USB. The patch is available here:

Re: two small scsi fixes for 3.15-rc3

2014-04-25 Thread James Bottomley
On Fri, 2014-04-25 at 13:09 +0200, Christoph Hellwig wrote: Hi Linus, hi James, these are two simple use after free fixes that fix a regression introduced by me in the first scsi update for 3.15-rc1. I've sent them to the scsi list 10 days ago and haven't seen any reply to them, and I'd

Re: [PATCH] scsi: replace numeric messages with string error messages when blk_execute_rq fails. Also add printing of sense info.

2014-04-25 Thread Maurizio Lombardi
Hi, On Fri, Apr 25, 2014 at 03:12:19PM +0200, Christoph Hellwig wrote: Looks useful, but why do we have basically two copies of the same code for different commands? Looking at them in detail they mostly look like copies of scsi_execute/scsi_execute_req_flags and should be switched to that.

[PATCH] [SCSI] mpt2sas: Don't disable device twice at suspend.

2014-04-25 Thread Tyler Stachecki
On suspend, _scsih_suspend calls mpt2sas_base_free_resources, which in turn calls pci_disable_device if the device is enabled prior to suspending. However, _scsih_suspend also calls pci_disable_device itself. Thus, in the event that the device is enabled prior to suspending, pci_disable_device

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

2014-04-25 Thread David Rientjes
On Fri, 25 Apr 2014, James Bottomley wrote: diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 65a123d..9db097a 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -137,6 +137,7 @@ static void __scsi_queue_insert(struct scsi_cmnd *cmd, int reason, int

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

2014-04-25 Thread Linus Torvalds
On Fri, Apr 25, 2014 at 3:49 PM, David Rientjes rient...@google.com wrote: Hmm, I see why this is needed because of the scsi_put_command(cmd), but I think you need to do struct scsi_device *sdev = ACCESS_ONCE(cmd-device) instead to prevent gcc from messing with the code generation. No, if gcc

Re: [PATCH v2 07/12] scsi/NCR5380: adopt NCR5380_dprint() and NCR5380_dprint_phase()

2014-04-25 Thread Michael Schmitz
Acked-by: Michael Schmitz schm...@debian.org All NCR5380 drivers already include the NCR5380.h header. Better to adopt those macros rather than have three variations on them. Moreover, the macros in NCR5380.h are preferable anyway: the atari_NCR5380 and sun3_NCR5380 versions are inflexible.

Re: [PATCH v2 08/12] scsi/NCR5380: adopt dprintk()

2014-04-25 Thread Michael Schmitz
Acked-by: Michael Schmitz schm...@debian.org All NCR5380 drivers already include the NCR5380.h header. Better to adopt those macros rather than have three variations on them. Moreover, the macros in NCR5380.h are preferable because the atari_NCR5380 and sun3_NCR5380 versions are inflexible.

Re: [PATCH v2 10/12] scsi/NCR5380: remove unused macro definitions

2014-04-25 Thread Michael Schmitz
Acked-by: MIchael Schmitz schm...@debian.org Remove the unused (and divergent) debugging macro definitions from the sun3_NCR5380 and atari_NCR5380 drivers. These drivers have been converted to use the common macros in NCR5380.h. Signed-off-by: Finn Thain fth...@telegraphics.com.au ---