xen_pvscsi: reclaim the ring request when mapping data failed
Subsystems (3)
PATCH 1/1 xen_pvscsi: reclaim the ring request when mapping data failed
During scsi command queueing, if mapping data fails, we need to reclaim the failed request. Otherwise, the garbage request will be pushed into the ring for the backend to work.
--- drivers/scsi/xen-scsifront.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/xen-scsifront.c +1 -0
@@ -565,6 +565,7 @@ static int scsifront_queuecommand(struct Scsi_Host *shost, err =map_data_for_request (info, sc, ring_req, shadow);if (err <0 ) {pr_debug ("%s: err %d\n" , __func__, err); + info->ring.req_prod_pvt--;scsifront_put_rqid (info, rqid);scsifront_return (info);spin_unlock_irqrestore (shost->host_lock, flags);
Signature · 1 line
2.3.2 (Apple Git-55)
Juergen Gross
maintainerQuoted 3 lines · Bin Wu
During scsi command queueing, if mapping data fails, we need to reclaim the failed request. Otherwise, the garbage request will be pushed into the ring for the backend to work.
Well spotted. There is another instance of this problem in scsifront_action_handler(). Would you mind correcting this one, too?
Juergen
Quoted 19 lines
Signed-off-by Bin Wu <[email protected]>--- drivers/scsi/xen-scsifront.c | 1 + 1 file changed, 1 insertion(+)drivers/scsi/xen-scsifront.c +1
-0@@ -565,6 +565,7 @@ static int scsifront_queuecommand(struct Scsi_Host *shost, err =map_data_for_request (info, sc, ring_req, shadow);if (err <0 ) {pr_debug ("%s: err %d\n" , __func__, err); + info->ring.req_prod_pvt--;scsifront_put_rqid (info, rqid);scsifront_return (info);spin_unlock_irqrestore(shost->host_lock, flags);
Quoted 7 lines · Juergen Gross
Quoted 3 lines · Bin Wu
During scsi command queueing, if mapping data fails, we need to reclaim the failed request. Otherwise, the garbage request will be pushed into the ring for the backend to work.
Well spotted. There is another instance of this problem in
scsifront_action_handler(). Would you mind correcting this one, too?
Would it make more sense to advance req_prod_pvt only if the request has been successfully created?
David
Quoted 25 lines
Quoted 17 lines
Signed-off-by Bin Wu <[email protected]>--- drivers/scsi/xen-scsifront.c | 1 + 1 file changed, 1 insertion(+)drivers/scsi/xen-scsifront.c +1
-0@@ -565,6 +565,7 @@ static int scsifront_queuecommand(struct Scsi_Host *shost, err =map_data_for_request (info, sc, ring_req, shadow);if (err <0 ) {pr_debug ("%s: err %d\n" , __func__, err); + info->ring.req_prod_pvt--;scsifront_put_rqid (info, rqid);scsifront_return (info);Quoted 1 line
spin_unlock_irqrestore(shost->host_lock, flags);_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Juergen Gross
maintainerQuoted 11 lines · David Vrabel
Quoted 7 lines · Juergen Gross
Quoted 3 lines · Bin Wu
During scsi command queueing, if mapping data fails, we need to reclaim the failed request. Otherwise, the garbage request will be pushed into the ring for the backend to work.
Well spotted. There is another instance of this problem in
scsifront_action_handler(). Would you mind correcting this one, too?Would it make more sense to advance
req_prod_pvtonly if the request has been successfully created?
Yeah, probably as the first action in scsifront_do_request().
Juergen
Quoted 30 lines
David
Quoted 25 lines
Quoted 17 lines
Signed-off-by Bin Wu <[email protected]>--- drivers/scsi/xen-scsifront.c | 1 + 1 file changed, 1 insertion(+)drivers/scsi/xen-scsifront.c +1
-0@@ -565,6 +565,7 @@ static int scsifront_queuecommand(struct Scsi_Host *shost, err =map_data_for_request (info, sc, ring_req, shadow);if (err <0 ) {pr_debug ("%s: err %d\n" , __func__, err); + info->ring.req_prod_pvt--;scsifront_put_rqid (info, rqid);scsifront_return (info);Quoted 1 line
spin_unlock_irqrestore(shost->host_lock, flags);_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 6 lines · Juergen Gross
Quoted 5 lines · David Vrabel
Quoted 4 lines · Juergen Gross
Quoted 3 lines · Bin Wu
During scsi command queueing, if mapping data fails, we need to reclaim the failed request. Otherwise, the garbage request will be pushed into the ring for the backend to work.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Well spotted. There is another instance of this problem in
scsifront_action_handler(). Would you mind correcting this one, too?Would it make more sense to advance
req_prod_pvtonly if the request has been successfully created?Yeah, probably as the first action in
scsifront_do_request().Juergen
ok, I will send a new patch : )
Quoted 31 lines
Quoted 28 lines
David
Quoted 24 lines
Quoted 17 lines
Signed-off-by Bin Wu <[email protected]>--- drivers/scsi/xen-scsifront.c | 1 + 1 file changed, 1 insertion(+)drivers/scsi/xen-scsifront.c +1
-0@@ -565,6 +565,7 @@ static int scsifront_queuecommand(struct Scsi_Host *shost, err =map_data_for_request (info, sc, ring_req, shadow);if (err <0 ) {pr_debug ("%s: err %d\n" , __func__, err); + info->ring.req_prod_pvt--;scsifront_put_rqid (info, rqid);scsifront_return (info);Quoted 1 line
spin_unlock_irqrestore(shost->host_lock, flags);_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel.
Quoted 6 lines · Juergen Gross
Quoted 5 lines · David Vrabel
Quoted 4 lines · Juergen Gross
Quoted 3 lines · Bin Wu
During scsi command queueing, if mapping data fails, we need to reclaim the failed request. Otherwise, the garbage request will be pushed into the ring for the backend to work.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Well spotted. There is another instance of this problem in
scsifront_action_handler(). Would you mind correcting this one, too?Would it make more sense to advance
req_prod_pvtonly if the request has been successfully created?Yeah, probably as the first action in
scsifront_do_request().Juergen
ok, I will send a new patch : )
Quoted 29 lines
Quoted 28 lines
David
Quoted 24 lines
Quoted 17 lines
Signed-off-by Bin Wu <[email protected]>--- drivers/scsi/xen-scsifront.c | 1 + 1 file changed, 1 insertion(+)drivers/scsi/xen-scsifront.c +1
-0@@ -565,6 +565,7 @@ static int scsifront_queuecommand(struct Scsi_Host *shost, err =map_data_for_request (info, sc, ring_req, shadow);if (err <0 ) {pr_debug ("%s: err %d\n" , __func__, err); + info->ring.req_prod_pvt--;scsifront_put_rqid (info, rqid);scsifront_return (info);Quoted 1 line
spin_unlock_irqrestore(shost->host_lock, flags);_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 2 lines
.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 7 lines · Juergen Gross
Quoted 3 lines · Bin Wu
During scsi command queueing, if mapping data fails, we need to reclaim the failed request. Otherwise, the garbage request will be pushed into the ring for the backend to work.
Well spotted. There is another instance of this problem in
scsifront_action_handler(). Would you mind correcting this one, too?
Would it make more sense to advance req_prod_pvt only if the request has been successfully created?
David
Quoted 16 lines
Quoted 16 lines
Signed-off-by Bin Wu <[email protected]>--- drivers/scsi/xen-scsifront.c | 1 + 1 file changed, 1 insertion(+)drivers/scsi/xen-scsifront.c +1
-0@@ -565,6 +565,7 @@ static int scsifront_queuecommand(struct Scsi_Host *shost, err =map_data_for_request (info, sc, ring_req, shadow);if (err <0 ) {pr_debug ("%s: err %d\n" , __func__, err); + info->ring.req_prod_pvt--;scsifront_put_rqid (info, rqid);
Quoted 9 lines
Quoted 2 lines
drivers/scsi/xen-scsifront.c +0
-0scsifront_return (info);spin_unlock_irqrestore(shost->host_lock, flags);_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Juergen Gross
maintainerQuoted 3 lines · Bin Wu
During scsi command queueing, if mapping data fails, we need to reclaim the failed request. Otherwise, the garbage request will be pushed into the ring for the backend to work.
Well spotted. There is another instance of this problem in scsifront_action_handler(). Would you mind correcting this one, too?
Juergen
Quoted 18 lines
Signed-off-by Bin Wu <[email protected]>--- drivers/scsi/xen-scsifront.c | 1 + 1 file changed, 1 insertion(+)drivers/scsi/xen-scsifront.c +1
-0@@ -565,6 +565,7 @@ static int scsifront_queuecommand(struct Scsi_Host *shost, err =map_data_for_request (info, sc, ring_req, shadow);if (err <0 ) {pr_debug ("%s: err %d\n" , __func__, err); + info->ring.req_prod_pvt--;scsifront_put_rqid (info, rqid);scsifront_return (info);
Quoted 1 line
spin_unlock_irqrestore(shost->host_lock, flags);
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel