[GIT PULL] First round of SCSI updates for the 3.5+ merge window

2012-07-23 Thread James Bottomley
The most important feature of this patch set is the new async infrastructure that makes sure async_synchronize_full() synchronizes all domains and allows us to remove all the hacks (like having scsi_complete_async_scans() in the device base code) and means that the async infrastructure will "just w

Re: scsi_requeue_command and dropping reference to sdev_gendev

2012-07-23 Thread James Bottomley
On Mon, 2012-07-23 at 21:13 -0700, Ani Sinha wrote: > Hi : > > I am looking at the latest upstream code and I see a potential issue : > > - scsi_requeue_command() drops reference to scsi_device->sdev_gendev in > scsi_unprep_request->scsi_put_command()->__scsi_put_command(). This can > trigger the

Re: [PATCH] scsi_lib: add NULL check to scsi_setup_blk_pc_cmnd

2012-07-23 Thread James Bottomley
On Mon, 2012-07-23 at 15:24 -0400, Jörn Engel wrote: > On Mon, 23 July 2012 23:45:55 +0400, James Bottomley wrote: > > On Mon, 2012-07-23 at 13:32 -0400, Jörn Engel wrote: > > > At least two slightly different paths can lead to a NULL pointer > > > dereference in scsi_prep_state_check and have been

scsi_requeue_command and dropping reference to sdev_gendev

2012-07-23 Thread Ani Sinha
Hi : I am looking at the latest upstream code and I see a potential issue : - scsi_requeue_command() drops reference to scsi_device->sdev_gendev in scsi_unprep_request->scsi_put_command()->__scsi_put_command(). This can trigger the cleanup routine scsi_device_dev_release_usercontext() that will d

[PATCH] tcm_vhost: Expose ABI version via VHOST_SCSI_GET_ABI_VERSION

2012-07-23 Thread Nicholas A. Bellinger
From: Nicholas Bellinger As requested by Anthony, here is a patch against target-pending/for-next-merge to expose an ABI version to userspace via a new VHOST_SCSI_GET_ABI_VERSION ioctl operation. As mentioned in the comment, ABI Rev 0 is for pre 2012 out-of-tree code, and ABI Rev 1 (the current

Re: [PATCH 5/5] block: genhd: add an interface to set disk's poll interval

2012-07-23 Thread Aaron Lu
On Mon, Jul 23, 2012 at 12:43:34PM -0600, Betty Dall wrote: > Hi Aaron, Hi, > > On Mon, 2012-07-23 at 14:49 +0800, Aaron Lu wrote: > > Set the ODD's in kernel poll interval to 2s for the user in case the > > user is using an old distro on which udev will not set the system wide > > block paramet

Re: [PATCH 4/5] scsi: pm: use runtime resume callback if available

2012-07-23 Thread Aaron Lu
Hi, On Mon, Jul 23, 2012 at 06:36:12PM +0400, Sergei Shtylyov wrote: > Hello. > > On 07/23/2012 10:49 AM, Aaron Lu wrote: > > > When runtime resume a scsi device, if the device's driver has > > implemented runtime resume callback, use that instead of the resume > > callback. > > > sr driver nee

Re: [PATCH] scsi_lib: add NULL check to scsi_setup_blk_pc_cmnd

2012-07-23 Thread Jörn Engel
On Mon, 23 July 2012 23:45:55 +0400, James Bottomley wrote: > On Mon, 2012-07-23 at 13:32 -0400, Jörn Engel wrote: > > At least two slightly different paths can lead to a NULL pointer > > dereference in scsi_prep_state_check and have been hit in practice. > > Have you checked this with the patches

Re: [PATCH] scsi_lib: add NULL check to scsi_setup_blk_pc_cmnd

2012-07-23 Thread James Bottomley
On Mon, 2012-07-23 at 13:32 -0400, Jörn Engel wrote: > At least two slightly different paths can lead to a NULL pointer > dereference in scsi_prep_state_check and have been hit in practice. Have you checked this with the patches in scsi-misc? There's a series of patches in there that alters the w

[PATCH] scsi_lib: add NULL check to scsi_setup_blk_pc_cmnd

2012-07-23 Thread Jörn Engel
At least two slightly different paths can lead to a NULL pointer dereference in scsi_prep_state_check and have been hit in practice. 1. Call Trace: [] scsi_setup_blk_pc_cmnd+0x2b/0x170 [] sd_prep_fn+0x568/0xdd0 [] blk_peek_request+0xb4/0x240 [] scsi_request_fn+0x43e/0x4a0 [] __blk_run_queue+0x

Re: [PATCH 5/5] block: genhd: add an interface to set disk's poll interval

2012-07-23 Thread Betty Dall
Hi Aaron, On Mon, 2012-07-23 at 14:49 +0800, Aaron Lu wrote: > Set the ODD's in kernel poll interval to 2s for the user in case the > user is using an old distro on which udev will not set the system wide > block parameter events_dfl_poll_msecs. Why did you pick 2 seconds? > > Signed-off-by: Aa

Re: 'Device not ready' issue on mpt2sas since 3.1.10

2012-07-23 Thread Tejun Heo
Hello, On Mon, Jul 23, 2012 at 01:14:00AM +0200, Matthias Prager wrote: > as it turns out my workaround (setting allow_restart=1) isn't all that > useful after all. There are no more i/o errors because the drive just > never goes to standby mode anymore (at least 'hdparm -y /dev/sda' does > not se

Re: [PATCH 2/5] scsi: sr: runtime pm when ODD is open/closed

2012-07-23 Thread Alan Stern
On Mon, 23 Jul 2012, Aaron Lu wrote: > The ODD can either be runtime resumed by the user or by a software > request. And for the latter part, we only support runtime resume the ODD > when the eject request is received. We did this in sr's block ioctl > function, this looks ugly. > > Change this b

Re: [PATCH 1/5] scsi: sr: fix for sr suspend and resume

2012-07-23 Thread Alan Stern
On Mon, 23 Jul 2012, Aaron Lu wrote: > In sr_suspend, we do not need to do anything if it is not a runtime pm > request, so just return by checking the PM_EVENT_AUTO flag. > And in sr_resume, only reset the suspend_count back to 1 if the ODD is > waken up by the user, or the usage count of the scs

Re: [PATCH 4/5] scsi: pm: use runtime resume callback if available

2012-07-23 Thread Sergei Shtylyov
Hello. On 07/23/2012 10:49 AM, Aaron Lu wrote: > When runtime resume a scsi device, if the device's driver has > implemented runtime resume callback, use that instead of the resume > callback. > sr driver needs this to properly do different things for system resume > and runtime resume. > Signe

[PATCH 3/5] scsi: sr: block events when runtime suspended

2012-07-23 Thread Aaron Lu
When the ODD is runtime suspended, there is no need to poll it for events, so block events poll for it and unblock when resumed. Signed-off-by: Aaron Lu --- block/genhd.c | 2 ++ drivers/scsi/sr.c | 7 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/block/genhd.c b/blo