linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers/block/xen-blkback: preq.dev is used without initialized
@ 2013-02-27  4:52 Chen Gang
  2013-02-27  9:49 ` Jan Beulich
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Chen Gang @ 2013-02-27  4:52 UTC (permalink / raw)
  To: konrad.wilk, roger.pau, jbeulich, stefano.stabellini, dgdegra,
	linux-kernel


  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).

Signed-off-by: Chen Gang <gang.chen@asianux.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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] drivers/block/xen-blkback: preq.dev is used without initialized
  2013-02-27  4:52 [PATCH] drivers/block/xen-blkback: preq.dev is used without initialized Chen Gang
@ 2013-02-27  9:49 ` Jan Beulich
  2013-02-27  9:50 ` Roger Pau Monné
  2013-02-27  9:57 ` Jan Beulich
  2 siblings, 0 replies; 9+ messages in thread
From: Jan Beulich @ 2013-02-27  9:49 UTC (permalink / raw)
  To: Chen Gang, konrad.wilk
  Cc: roger.pau, stefano.stabellini, xen-devel, dgdegra, linux-kernel

>>> On 27.02.13 at 05:52, Chen Gang <gang.chen@asianux.com> 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).
> 
> 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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drivers/block/xen-blkback: preq.dev is used without initialized
  2013-02-27  4:52 [PATCH] drivers/block/xen-blkback: preq.dev is used without initialized Chen Gang
  2013-02-27  9:49 ` Jan Beulich
@ 2013-02-27  9:50 ` Roger Pau Monné
  2013-02-27 10:03   ` Jan Beulich
  2013-02-27  9:57 ` Jan Beulich
  2 siblings, 1 reply; 9+ messages in thread
From: Roger Pau Monné @ 2013-02-27  9:50 UTC (permalink / raw)
  To: Chen Gang
  Cc: konrad.wilk, jbeulich, Stefano Stabellini, dgdegra, linux-kernel

On 27/02/13 05:52, 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).

preq.dev is initialized a a couple of lines prior to calling
xen_vbd_translate:

preq.dev           = req->u.rw.handle;

> Signed-off-by: Chen Gang <gang.chen@asianux.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;
>  	}
>  
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drivers/block/xen-blkback: preq.dev is used without initialized
  2013-02-27  4:52 [PATCH] drivers/block/xen-blkback: preq.dev is used without initialized Chen Gang
  2013-02-27  9:49 ` Jan Beulich
  2013-02-27  9:50 ` Roger Pau Monné
@ 2013-02-27  9:57 ` Jan Beulich
  2013-02-27 10:38   ` Chen Gang
  2 siblings, 1 reply; 9+ messages in thread
From: Jan Beulich @ 2013-02-27  9:57 UTC (permalink / raw)
  To: Chen Gang
  Cc: roger.pau, stefano.stabellini, xen-devel, konrad.wilk, dgdegra,
	linux-kernel

>>> On 27.02.13 at 05:52, Chen Gang <gang.chen@asianux.com> 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).

You also could have mentioned that even 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.

Jan

> Signed-off-by: Chen Gang <gang.chen@asianux.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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drivers/block/xen-blkback: preq.dev is used without initialized
  2013-02-27  9:50 ` Roger Pau Monné
@ 2013-02-27 10:03   ` Jan Beulich
  0 siblings, 0 replies; 9+ messages in thread
From: Jan Beulich @ 2013-02-27 10:03 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: Chen Gang, Stefano Stabellini, konrad.wilk, dgdegra, linux-kernel

>>> On 27.02.13 at 10:50, Roger Pau Monné<roger.pau@citrix.com> wrote:
> On 27/02/13 05:52, 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).
> 
> preq.dev is initialized a a couple of lines prior to calling
> xen_vbd_translate:
> 
> preq.dev           = req->u.rw.handle;

Not anymore after 01c681d4c70d64cb72142a2823f27c4146a02e63
(in Konrad's tree).

Jan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drivers/block/xen-blkback: preq.dev is used without initialized
  2013-02-27  9:57 ` Jan Beulich
@ 2013-02-27 10:38   ` Chen Gang
  2013-02-27 10:45     ` Jan Beulich
  0 siblings, 1 reply; 9+ messages in thread
From: Chen Gang @ 2013-02-27 10:38 UTC (permalink / raw)
  To: Jan Beulich
  Cc: roger.pau, stefano.stabellini, xen-devel, konrad.wilk, dgdegra,
	linux-kernel

于 2013年02月27日 17:57, Jan Beulich 写道:
> You also could have mentioned that even 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.

  pardon ?

  I guess what you said is :
    my patch seems ok, but the comments need improving.
    need add "additional info" in comments:
      "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".

  is it correct ?

  thanks.

-- 
Chen Gang

Asianux Corporation

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drivers/block/xen-blkback: preq.dev is used without initialized
  2013-02-27 10:38   ` Chen Gang
@ 2013-02-27 10:45     ` Jan Beulich
  2013-02-27 15:40       ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Beulich @ 2013-02-27 10:45 UTC (permalink / raw)
  To: Chen Gang
  Cc: roger.pau, stefano.stabellini, xen-devel, konrad.wilk, dgdegra,
	linux-kernel

>>> On 27.02.13 at 11:38, Chen Gang <gang.chen@asianux.com> wrote:
> 于 2013年02月27日 17:57, Jan Beulich 写道:
>> You also could have mentioned that even 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.
> 
>   pardon ?
> 
>   I guess what you said is :
>     my patch seems ok, but the comments need improving.
>     need add "additional info" in comments:
>       "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".
> 
>   is it correct ?

Yes (and you might have missed the ACK that I had already sent
before this reply - that mail got bounced for your address).

Jan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drivers/block/xen-blkback: preq.dev is used without initialized
  2013-02-27 10:45     ` Jan Beulich
@ 2013-02-27 15:40       ` Konrad Rzeszutek Wilk
  2013-02-28  1:20         ` Chen Gang
  0 siblings, 1 reply; 9+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-02-27 15:40 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Chen Gang, roger.pau, stefano.stabellini, xen-devel, dgdegra,
	linux-kernel

On Wed, Feb 27, 2013 at 10:45:35AM +0000, Jan Beulich wrote:
> >>> On 27.02.13 at 11:38, Chen Gang <gang.chen@asianux.com> wrote:
> > 于 2013年02月27日 17:57, Jan Beulich 写道:
> >> You also could have mentioned that even 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.
> > 
> >   pardon ?
> > 
> >   I guess what you said is :
> >     my patch seems ok, but the comments need improving.
> >     need add "additional info" in comments:
> >       "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".
> > 
> >   is it correct ?
> 
> Yes (and you might have missed the ACK that I had already sent
> before this reply - that mail got bounced for your address).

Yup. Chen, could you respin the patch with the extra comment and
the Ack from Jan please?

Thank you!
> 
> Jan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drivers/block/xen-blkback: preq.dev is used without initialized
  2013-02-27 15:40       ` Konrad Rzeszutek Wilk
@ 2013-02-28  1:20         ` Chen Gang
  0 siblings, 0 replies; 9+ messages in thread
From: Chen Gang @ 2013-02-28  1:20 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Jan Beulich, roger.pau, stefano.stabellini, xen-devel, dgdegra,
	linux-kernel

于 2013年02月27日 23:40, Konrad Rzeszutek Wilk 写道:
> On Wed, Feb 27, 2013 at 10:45:35AM +0000, Jan Beulich wrote:
>> > 
>> > Yes (and you might have missed the ACK that I had already sent
>> > before this reply - that mail got bounced for your address).
> Yup. Chen, could you respin the patch with the extra comment and
> the Ack from Jan please?

  ok, I will send patch v2.

  :-)

-- 
Chen Gang

Asianux Corporation

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-02-28  1:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-27  4:52 [PATCH] drivers/block/xen-blkback: preq.dev is used without initialized Chen Gang
2013-02-27  9:49 ` Jan Beulich
2013-02-27  9:50 ` Roger Pau Monné
2013-02-27 10:03   ` Jan Beulich
2013-02-27  9:57 ` Jan Beulich
2013-02-27 10:38   ` Chen Gang
2013-02-27 10:45     ` Jan Beulich
2013-02-27 15:40       ` Konrad Rzeszutek Wilk
2013-02-28  1:20         ` Chen Gang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).