Re: VIRTIO_BLK_T_SCSI_CMD handling in virtio-blk
From: Christian Borntraeger
Date: Wed Mar 18 2009 - 05:37:34 EST
Am Wednesday 18 March 2009 10:16:43 schrieb Hannes Reinecke:
> -ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂend_dequeued_request(vbr->req, uptodate);
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂif (blk_pc_request(vbr->req)) {
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂvbr->req->data_len = vbr->in_hdr.residual;
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂbytes = vbr->in_hdr.data_len;
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂvbr->req->sense_len = vbr->in_hdr.sense_len;
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂvbr->req->errors = vbr->in_hdr.status;
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ} else
I think we identified a bug in the old patch:
http://kerneltrap.org/mailarchive/linux-kvm/2008/8/29/3127594
http://kerneltrap.org/index.php?q=mailarchive/linux-kvm/2008/8/29/3128124
Is this fixup still valid?
- if (blk_pc_request(vbr->req)) {
+ if (blk_pc_request(vbr->req) && len >= sizeof(vbr->in_hdr)) {
I forgot almost all details about the problem.
Christian
èº{.nÇ+·®+%Ëlzwm
ébëæìr¸zX§»®w¥{ayºÊÚë,j¢f£¢·hàz¹®w¥¢¸¢·¦j:+v¨wèjØm¶ÿ¾«êçzZ+ùÝj"ú!¶iOæ¬z·vØ^¶m§ÿðÃnÆàþY&