Re: [PATCH v2] virtio_blk: Fix a slient kernel panic

2016-07-18 Thread Minfei Huang
On 07/18/16 at 06:25P, Cornelia Huck wrote: > On Tue, 19 Jul 2016 00:18:32 +0800 > Minfei Huang wrote: > > > On 07/18/16 at 05:21P, Cornelia Huck wrote: > > > On Mon, 18 Jul 2016 22:01:29 +0800 > > > Minfei Huang wrote: > > > > diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c

Re: [PATCH v2] virtio_blk: Fix a slient kernel panic

2016-07-18 Thread Cornelia Huck
On Tue, 19 Jul 2016 00:18:32 +0800 Minfei Huang wrote: > On 07/18/16 at 05:21P, Cornelia Huck wrote: > > On Mon, 18 Jul 2016 22:01:29 +0800 > > Minfei Huang wrote: > > > diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c > > > index 42758b5..d920512 100644 > > > --- a/drivers/b

Re: [PATCH v2] virtio_blk: Fix a slient kernel panic

2016-07-18 Thread Minfei Huang
On 07/18/16 at 05:21P, Cornelia Huck wrote: > On Mon, 18 Jul 2016 22:01:29 +0800 > Minfei Huang wrote: > > diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c > > index 42758b5..d920512 100644 > > --- a/drivers/block/virtio_blk.c > > +++ b/drivers/block/virtio_blk.c > > @@ -381,9

Re: [PATCH v2] virtio_blk: Fix a slient kernel panic

2016-07-18 Thread Cornelia Huck
On Mon, 18 Jul 2016 22:01:29 +0800 Minfei Huang wrote: > We do a lot of memory allocation in function init_vq, and don't handle > the allocation failure properly. Then this function will return 0, > although initialization fails due to lacking memory. At that moment, > kernel will panic in guest

[PATCH v2] virtio_blk: Fix a slient kernel panic

2016-07-18 Thread Minfei Huang
We do a lot of memory allocation in function init_vq, and don't handle the allocation failure properly. Then this function will return 0, although initialization fails due to lacking memory. At that moment, kernel will panic in guest machine, if virtio is used to drive disk. To fix this bug, we sh