All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Feng <fengli@smartx.com>
To: Raphael Norwitz <raphael.norwitz@nutanix.com>
Cc: lifeng1519@gmail.com, Yang Fan <fanyang@smartx.com>,
	Kyle Zhang <kyle@smartx.com>,
	"open list:All patches CC here" <qemu-devel@nongnu.org>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Fwd: [PATCH 4/4] vhost-user-blk: fix crash in realize process
Date: Fri, 17 Apr 2020 18:07:35 +0800	[thread overview]
Message-ID: <CAHckoCx4brFwyq0Xz=FijRnuTfXgPzJGE+Pxb2F19EV_ijPksg@mail.gmail.com> (raw)
In-Reply-To: <CAHckoCwsLwqNhVHK4PF+pzt5ExkurPNsWLw7ueRG8dfOUA2rXg@mail.gmail.com>

Add mail group list.

Thank you, Raphael .

Raphael Norwitz <raphael.norwitz@nutanix.com> 于2020年4月17日周五 下午12:10写道:
>
> Mostly looks good - just a few superficial notes.
>
> On Wed, Apr 15, 2020 at 11:28:26AM +0800, Li Feng wrote:
> > 1. set s->connected to true after vhost_dev_init;
> > 2. call vhost_dev_get_config when s->connected is true, otherwise the
> >     hdev->host_ops will be nullptr.
>
> You mean hdev->vhost_ops, right?
>
Yes.
> >
> > Signed-off-by: Li Feng <fengli@smartx.com>
> > ---
> >  hw/block/vhost-user-blk.c | 47 +++++++++++++++++++++++++----------------------
> >  1 file changed, 25 insertions(+), 22 deletions(-)
> > +    /*
> > +     * set true util vhost_dev_init return ok, because CLOSE event may happen
> > +     * in vhost_dev_init routine.
> > +     */
>
> I'm a little confused by this comment. Do you mean to say “wait until vhost_dev_init
> succeeds to set connected to true, because a close event may happen while
> vhost_dev_init is executing”?
Yes. This is the exception path:
qemu_chr_fe_set_handlers
   -> vhost_user_blk_event(OPEN)
       -> vhost_user_blk_connect
            -> vhost_dev_init
                -> vhost_user_blk_event(CLOSE)
                -> vhost_dev_cleanup
We should set connected to true only when vhost_dev_init returns OK.
If a close event is triggered, we shouldn't set connected to true.

-- 
The SmartX email address is only for business purpose. Any sent message 
that is not related to the business is not authorized or permitted by 
SmartX.
本邮箱为北京志凌海纳科技有限公司(SmartX)工作邮箱. 如本邮箱发出的邮件与工作无关,该邮件未得到本公司任何的明示或默示的授权.




  parent reply	other threads:[~2020-04-17 10:08 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15  3:28 [PATCH 0/4] fix crashes when inject errors to vhost-user-blk chardev Li Feng
2020-04-15  3:28 ` [PATCH 1/4] vhost-user-blk: delay vhost_user_blk_disconnect Li Feng
2020-04-14  1:24   ` Raphael Norwitz
2020-04-20 11:18     ` Li Feng
2020-04-15  3:28 ` [PATCH 2/4] vhost-user-blk: fix invalid memory access Li Feng
2020-04-14  1:44   ` Raphael Norwitz
2020-04-15  3:28 ` [PATCH 3/4] char-socket: avoid double call tcp_chr_free_connection Li Feng
2020-04-15 10:35   ` Marc-André Lureau
2020-04-20  3:10     ` Li Feng
2020-04-20 14:28       ` Marc-André Lureau
2020-04-28  8:51   ` [PATCH v2] char-socket: initialize reconnect timer only when the timer doesn't start Li Feng
     [not found]     ` <20200508051441.8143-1-fengli@smartx.com>
2020-05-08  5:14       ` [PATCH v3 1/2] io/channel: fix crash when qio_channel_readv_all return 0 Li Feng
2020-05-08 12:32         ` Marc-André Lureau
2020-05-08 12:42           ` Li Feng
2020-05-11 10:02             ` Daniel P. Berrangé
2020-05-11 12:09               ` Li Feng
2020-05-08  5:14       ` [PATCH v3 2/2] char-socket: initialize reconnect timer only when the timer doesn't start Li Feng
2020-05-08 11:00         ` Marc-André Lureau
2020-05-08 12:16           ` Li Feng
2020-05-08 12:28             ` Marc-André Lureau
2020-05-08 12:31               ` Li Feng
2020-05-11 12:39     ` [PATCH v4] " Li Feng
2020-05-21 15:15       ` Paolo Bonzini
2020-04-28  8:54   ` [PATCH v2] " Li Feng
2020-04-28  8:59     ` Li Feng
2020-04-28 11:05       ` Marc-André Lureau
2020-04-28 14:09         ` Feng Li
2020-04-15  3:28 ` [PATCH 4/4] vhost-user-blk: fix crash in realize process Li Feng
2020-04-14  1:54   ` Raphael Norwitz
     [not found]     ` <CAHckoCwsLwqNhVHK4PF+pzt5ExkurPNsWLw7ueRG8dfOUA2rXg@mail.gmail.com>
2020-04-17 10:07       ` Li Feng [this message]
2020-04-17  9:45 ` [PATCH 0/4] fix crashes when inject errors to vhost-user-blk chardev Michael S. Tsirkin
2020-04-17 10:11   ` Li Feng

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='CAHckoCx4brFwyq0Xz=FijRnuTfXgPzJGE+Pxb2F19EV_ijPksg@mail.gmail.com' \
    --to=fengli@smartx.com \
    --cc=fanyang@smartx.com \
    --cc=kyle@smartx.com \
    --cc=lifeng1519@gmail.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=raphael.norwitz@nutanix.com \
    /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.