Re: [PATCH WIP 0/4] vhost-scsi: new device supporting the tcm_vhost Linux kernel module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2013-01-31 at 13:12 +0200, Michael S. Tsirkin wrote:
> On Wed, Jan 30, 2013 at 05:41:22PM +0100, Paolo Bonzini wrote:

<SNIP>

> > Another small bug I found is an ordering problem between
> > VHOST_SET_VRING_KICK and VHOST_SCSI_SET_ENDPOINT.  Starting the vq
> > causes a "vhost_scsi_handle_vq endpoint not set" error in dmesg.
> > Because of this I added the first two patches, which let me do
> > VHOST_SCSI_SET_ENDPOINT before VHOST_SET_VRING_KICK but after setting
> > up the vring.
> > 
> > Unfortunately, this is not enough to fix the hang.  And anyway, it's
> > probably simpler to avoid the two patches and remove this test from the
> > tcm_vhost.c vhost_scsi_set/clear_endpoint functions:
> > 
> >         mutex_lock(&vs->dev.mutex);
> >         /* Verify that ring has been setup correctly. */
> >         for (index = 0; index < vs->dev.nvqs; ++index) {
> >                 /* Verify that ring has been setup correctly. */
> >                 if (!vhost_vq_access_ok(&vs->vqs[index])) {
> >                         mutex_unlock(&vs->dev.mutex);
> >                         return -EFAULT;
> >                 }
> >         }
> >         mutex_unlock(&vs->dev.mutex);
> 
> Well userspace should initialize the kick eventfd to 0,
> it seems to init it to 1 which is why we get the error.
> But I think the only issue is pr_err: vhost-net already
> ignores such a kick with no backend. So let's just
> remove it, preferably for 3.8.
> 

That's fine with me.  Applying to target-pending/master, and will
include in the next PULL request for v3.8.0.

Thanks,

--nab

> --->
> tcm_vhost: fix pr_err on early kick
> 
> It's OK to get kick before backend is set or after
> it is cleared, we can just ignore it.
> 
> Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
> 
> ---
> 
> diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c
> index b20df5c..22321cf 100644
> --- a/drivers/vhost/tcm_vhost.c
> +++ b/drivers/vhost/tcm_vhost.c
> @@ -575,10 +575,8 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs)
>  
>  	/* Must use ioctl VHOST_SCSI_SET_ENDPOINT */
>  	tv_tpg = vs->vs_tpg;
> -	if (unlikely(!tv_tpg)) {
> -		pr_err("%s endpoint not set\n", __func__);
> +	if (unlikely(!tv_tpg))
>  		return;
> -	}
>  
>  	mutex_lock(&vq->mutex);
>  	vhost_disable_notify(&vs->dev, vq);


--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux