All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Byungchul Park <byungchul.park@lge.com>
Cc: kvm@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, kernel-team@lge.com
Subject: Re: [PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
Date: Thu, 16 Nov 2017 03:30:52 +0200	[thread overview]
Message-ID: <20171116033036-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20171115235239.GA4394@X58A-UD3R>

On Thu, Nov 16, 2017 at 08:52:39AM +0900, Byungchul Park wrote:
> On Thu, Nov 09, 2017 at 09:17:29AM +0900, Byungchul Park wrote:
> > I am sorry for having made a mistake on it.
> 
> Hello Nicholas,
> 
> Please consider this patch urgently. I'm sorry for having changed the
> original behavior with the previous patch.
> 
> The safe version of llist API should be used to keep the original
> behavior.
> 
> Thanks,
> Byungchul

I have included this patch in my tree.

> > -----8<-----
> > >From ba9a0f76dffceffa4fa3aa2d9be49cdb0d9b7d4f Mon Sep 17 00:00:00 2001
> > From: Byungchul Park <byungchul.park@lge.com>
> > Date: Thu, 9 Nov 2017 09:00:21 +0900
> > Subject: [PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
> > 
> > The following patch changed the behavior which originally did safe
> > iteration. Make it safe as it was.
> > 
> >    12bdcbd539c6327c09da0503c674733cb2d82cb5
> >    vhost/scsi: Don't reinvent the wheel but use existing llist API
> > 
> > Signed-off-by: Byungchul Park <byungchul.park@lge.com>
> > ---
> >  drivers/vhost/scsi.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
> > index 046f6d2..46539ca 100644
> > --- a/drivers/vhost/scsi.c
> > +++ b/drivers/vhost/scsi.c
> > @@ -519,7 +519,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work)
> >  					vs_completion_work);
> >  	DECLARE_BITMAP(signal, VHOST_SCSI_MAX_VQ);
> >  	struct virtio_scsi_cmd_resp v_rsp;
> > -	struct vhost_scsi_cmd *cmd;
> > +	struct vhost_scsi_cmd *cmd, *t;
> >  	struct llist_node *llnode;
> >  	struct se_cmd *se_cmd;
> >  	struct iov_iter iov_iter;
> > @@ -527,7 +527,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work)
> >  
> >  	bitmap_zero(signal, VHOST_SCSI_MAX_VQ);
> >  	llnode = llist_del_all(&vs->vs_completion_list);
> > -	llist_for_each_entry(cmd, llnode, tvc_completion_list) {
> > +	llist_for_each_entry_safe(cmd, t, llnode, tvc_completion_list) {
> >  		se_cmd = &cmd->tvc_se_cmd;
> >  
> >  		pr_debug("%s tv_cmd %p resid %u status %#02x\n", __func__,
> > -- 
> > 1.9.1

WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Byungchul Park <byungchul.park@lge.com>
Cc: nab@linux-iscsi.org, jasowang@redhat.com, kvm@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@lge.com
Subject: Re: [PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
Date: Thu, 16 Nov 2017 03:30:52 +0200	[thread overview]
Message-ID: <20171116033036-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20171115235239.GA4394@X58A-UD3R>

On Thu, Nov 16, 2017 at 08:52:39AM +0900, Byungchul Park wrote:
> On Thu, Nov 09, 2017 at 09:17:29AM +0900, Byungchul Park wrote:
> > I am sorry for having made a mistake on it.
> 
> Hello Nicholas,
> 
> Please consider this patch urgently. I'm sorry for having changed the
> original behavior with the previous patch.
> 
> The safe version of llist API should be used to keep the original
> behavior.
> 
> Thanks,
> Byungchul

I have included this patch in my tree.

> > -----8<-----
> > >From ba9a0f76dffceffa4fa3aa2d9be49cdb0d9b7d4f Mon Sep 17 00:00:00 2001
> > From: Byungchul Park <byungchul.park@lge.com>
> > Date: Thu, 9 Nov 2017 09:00:21 +0900
> > Subject: [PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
> > 
> > The following patch changed the behavior which originally did safe
> > iteration. Make it safe as it was.
> > 
> >    12bdcbd539c6327c09da0503c674733cb2d82cb5
> >    vhost/scsi: Don't reinvent the wheel but use existing llist API
> > 
> > Signed-off-by: Byungchul Park <byungchul.park@lge.com>
> > ---
> >  drivers/vhost/scsi.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
> > index 046f6d2..46539ca 100644
> > --- a/drivers/vhost/scsi.c
> > +++ b/drivers/vhost/scsi.c
> > @@ -519,7 +519,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work)
> >  					vs_completion_work);
> >  	DECLARE_BITMAP(signal, VHOST_SCSI_MAX_VQ);
> >  	struct virtio_scsi_cmd_resp v_rsp;
> > -	struct vhost_scsi_cmd *cmd;
> > +	struct vhost_scsi_cmd *cmd, *t;
> >  	struct llist_node *llnode;
> >  	struct se_cmd *se_cmd;
> >  	struct iov_iter iov_iter;
> > @@ -527,7 +527,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work)
> >  
> >  	bitmap_zero(signal, VHOST_SCSI_MAX_VQ);
> >  	llnode = llist_del_all(&vs->vs_completion_list);
> > -	llist_for_each_entry(cmd, llnode, tvc_completion_list) {
> > +	llist_for_each_entry_safe(cmd, t, llnode, tvc_completion_list) {
> >  		se_cmd = &cmd->tvc_se_cmd;
> >  
> >  		pr_debug("%s tv_cmd %p resid %u status %#02x\n", __func__,
> > -- 
> > 1.9.1

  reply	other threads:[~2017-11-16  1:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-09  0:17 [PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work() Byungchul Park
2017-11-15 23:52 ` Byungchul Park
2017-11-15 23:52 ` Byungchul Park
2017-11-16  1:30   ` Michael S. Tsirkin [this message]
2017-11-16  1:30     ` Michael S. Tsirkin
2017-11-16  1:33     ` Byungchul Park
2017-11-16  1:33     ` Byungchul Park
  -- strict thread matches above, loose matches on Subject: below --
2017-11-09  0:17 Byungchul Park

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171116033036-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=byungchul.park@lge.com \
    --cc=kernel-team@lge.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.