Skip to contentSkip to conversation

drivers/block/xen-blkback: preq.dev is used without initialized

PATCH Superseded Chen Gang 4 participants 15 messages Feb 27, 2013 – Feb 28, 2013

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 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).

---
 drivers/block/xen-blkback/blkback.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/block/xen-blkback/blkback.c +2 -1
index de1f319..6d1cc3d 100644
@@ -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;
 	}
 
Signature · 1 line
1.7.7.6
#1 lore raw
Quoted 3 lines · Chen Gang

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;

Quoted 20 lines
---
 drivers/block/xen-blkback/blkback.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/block/xen-blkback/blkback.c +2 -1
index de1f319..6d1cc3d 100644
@@ -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;
 	}
 
Acked-by on v1 1/1
#3 lore raw
In reply to Chen Gang
Quoted 6 lines
Quoted 1 line
Quoted 1 line · Chen Gang

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

Quoted 21 lines
---
 drivers/block/xen-blkback/blkback.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/block/xen-blkback/blkback.c +2 -1
index de1f319..6d1cc3d 100644
@@ -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;
 	}
 
Signature · 1 line
1.7.7.6
Acked-by on v1 1/1
#4 lore raw
In reply to Chen Gang
Quoted 6 lines
Quoted 1 line
Quoted 1 line · Chen Gang

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

Quoted 21 lines
---
 drivers/block/xen-blkback/blkback.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/block/xen-blkback/blkback.c +2 -1
index de1f319..6d1cc3d 100644
@@ -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;
 	}
 
Signature · 1 line
1.7.7.6
#5 lore raw
In reply to Chen Gang
Quoted 3 lines
Quoted 1 line
Quoted 1 line · Chen Gang

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

Quoted 22 lines
---
 drivers/block/xen-blkback/blkback.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/block/xen-blkback/blkback.c +2 -1
index de1f319..6d1cc3d 100644
@@ -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;
 	}
 
Signature · 1 line
1.7.7.6
#6 lore raw
In reply to Chen Gang
Quoted 3 lines
Quoted 1 line
Quoted 1 line · Chen Gang

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

Quoted 22 lines
---
 drivers/block/xen-blkback/blkback.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/block/xen-blkback/blkback.c +2 -1
index de1f319..6d1cc3d 100644
@@ -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;
 	}
 
Signature · 1 line
1.7.7.6
#2 lore raw
In reply to Roger Pau Monné
Quoted 10 lines
Quoted 1 line
Quoted 1 line · Roger Pau Monné
Quoted 3 lines · Chen Gang

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

author
#7 lore raw
In reply to Jan Beulich
Quoted 4 lines · 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.

Signature · 8 lines
Chen Gang

Asianux Corporation

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#8 lore raw
In reply to Jan Beulich
Quoted 4 lines · 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.

Signature · 3 lines
Chen Gang

Asianux Corporation
#9 lore raw
Quoted 17 lines
Quoted 1 line
Quoted 1 line · Chen Gang
Quoted 4 lines · 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".

Quoted 1 line

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

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#10 lore raw
In reply to Chen Gang
Quoted 17 lines
Quoted 1 line
Quoted 1 line · Chen Gang
Quoted 4 lines · 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".

Quoted 1 line

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

#11 lore raw
Quoted 17 lines · Jan Beulich
Quoted 17 lines
Quoted 1 line
Quoted 1 line · Chen Gang
Quoted 4 lines · 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".

Quoted 4 lines
Quoted 1 line

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!

Quoted 2 lines

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#12 lore raw
In reply to Jan Beulich
Quoted 17 lines · Jan Beulich
Quoted 17 lines
Quoted 1 line
Quoted 1 line · Chen Gang
Quoted 4 lines · 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".

Quoted 4 lines
Quoted 1 line

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!

Quoted 2 lines

Jan

author
#13 lore raw
Quoted 6 lines · Konrad Rzeszutek Wilk
Quoted 3 lines · Jan Beulich
Quoted 3 lines

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.

:-)

Signature · 8 lines
Chen Gang

Asianux Corporation

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#14 lore raw
In reply to Konrad Rzeszutek Wilk
Quoted 6 lines · Konrad Rzeszutek Wilk
Quoted 3 lines · Jan Beulich
Quoted 3 lines

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.

:-)

Signature · 3 lines
Chen Gang

Asianux Corporation