Tejun Heo wrote:Okay, I got it. Heh, it turns out SCSI and/or block layer is not ready for rq->data_len != sum(sg). When adjusted command completes, SCSI midlayer completes the command with rq->data_len for PC commands which eventually ends up in __end_that_request_first(). As there are extra sg area left after completing rq->data_len, blk layer says so to SCSI layer and SCSI layer retries the command only with the appended area. The following patch gets the writing going. I really think it's a serious mistake to break rq->data_len == sum(sg). If we break rq->data_len == requested size, the worst bugs are giving wrong size when issuing commands to application layer of devices which is relatively easy to spot and not all that command anyway. Breaking rq->data_len == sum(sg), bugs will be in internal mechanics, DMA engine programming and transport layer. Oh well... diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index fecba05..32439ac 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -757,7 +757,7 @@ void scsi_finish_command(struct scsi_cmnd *cmd) "Notifying upper driver of completion " "(result %x)\n", cmd->result)); - good_bytes = scsi_bufflen(cmd); + good_bytes = scsi_bufflen(cmd) + cmd->request->data_len; if (cmd->request->cmd_type != REQ_TYPE_BLOCK_PC) { drv = scsi_cmd_to_driver(cmd); if (drv->done) -- tejun --
| Andrew Morton | Re: Linux 2.6.21-rc4 |
| Andrew Morton | -mm merge plans for 2.6.23 |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Balbir Singh | Re: [RFC][PATCH 2/7] RSS controller core |
git: | |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| David Miller | [GIT]: Networking |
| Andreas Henriksson | [PATCH 06/12] Remove bogus reference to tc-filters(8) from tc(8) manpage. |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
