Chen Gang
2013-Feb-28 02:34 UTC
[PATCH v2] drivers/block/xen-blkback: preq.dev is used without initialized
if call xen_vbd_translate failed, the preq.dev will be not initialized. so use blkif->vbd.pdevice instead (still better to print relative info). additional information: before commit 01c681d4c70d64cb72142a2823f27c4146a02e63, the value printed here was bogus, as it was the guest provided value from req->u.rw.handle rather than the actual device. Signed-off-by: Chen Gang <gang.chen@asianux.com> Acked-by: Jan Beulich <JBeulich@suse.com> --- drivers/block/xen-blkback/blkback.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index de1f319..6d1cc3d 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c @@ -904,7 +904,8 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif, pr_debug(DRV_PFX "access denied: %s of [%llu,%llu] on dev=%04x\n", operation == READ ? "read" : "write", preq.sector_number, - preq.sector_number + preq.nr_sects, preq.dev); + preq.sector_number + preq.nr_sects, + blkif->vbd.pdevice); goto fail_response; } -- 1.7.7.6
Konrad Rzeszutek Wilk
2013-Mar-01 13:43 UTC
Re: [PATCH v2] drivers/block/xen-blkback: preq.dev is used without initialized
On Thu, Feb 28, 2013 at 10:34:23AM +0800, Chen Gang wrote:> > if call xen_vbd_translate failed, the preq.dev will be not initialized. > so use blkif->vbd.pdevice instead (still better to print relative info). > > additional information: > before commit 01c681d4c70d64cb72142a2823f27c4146a02e63, the value printed > here was bogus, as it was the guest provided value from req->u.rw.handle > rather than the actual device.applied with some changes to the description.> > Signed-off-by: Chen Gang <gang.chen@asianux.com> > Acked-by: Jan Beulich <JBeulich@suse.com> > --- > drivers/block/xen-blkback/blkback.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c > index de1f319..6d1cc3d 100644 > --- a/drivers/block/xen-blkback/blkback.c > +++ b/drivers/block/xen-blkback/blkback.c > @@ -904,7 +904,8 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif, > pr_debug(DRV_PFX "access denied: %s of [%llu,%llu] on dev=%04x\n", > operation == READ ? "read" : "write", > preq.sector_number, > - preq.sector_number + preq.nr_sects, preq.dev); > + preq.sector_number + preq.nr_sects, > + blkif->vbd.pdevice); > goto fail_response; > } > > -- > 1.7.7.6
Chen Gang
2013-Mar-05 00:54 UTC
Re: [PATCH v2] drivers/block/xen-blkback: preq.dev is used without initialized
于 2013年03月01日 21:43, Konrad Rzeszutek Wilk 写道:> On Thu, Feb 28, 2013 at 10:34:23AM +0800, Chen Gang wrote: >> >> if call xen_vbd_translate failed, the preq.dev will be not initialized. >> so use blkif->vbd.pdevice instead (still better to print relative info). >> >> additional information: >> before commit 01c681d4c70d64cb72142a2823f27c4146a02e63, the value printed >> here was bogus, as it was the guest provided value from req->u.rw.handle >> rather than the actual device. > > applied with some changes to the description. >thanks.>> >> Signed-off-by: Chen Gang <gang.chen@asianux.com> >> Acked-by: Jan Beulich <JBeulich@suse.com> >> --- >> drivers/block/xen-blkback/blkback.c | 3 ++- >> 1 files changed, 2 insertions(+), 1 deletions(-) >> >> diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c >> index de1f319..6d1cc3d 100644 >> --- a/drivers/block/xen-blkback/blkback.c >> +++ b/drivers/block/xen-blkback/blkback.c >> @@ -904,7 +904,8 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif, >> pr_debug(DRV_PFX "access denied: %s of [%llu,%llu] on dev=%04x\n", >> operation == READ ? "read" : "write", >> preq.sector_number, >> - preq.sector_number + preq.nr_sects, preq.dev); >> + preq.sector_number + preq.nr_sects, >> + blkif->vbd.pdevice); >> goto fail_response; >> } >> >> -- >> 1.7.7.6 > >-- Chen Gang Asianux Corporation _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel