Thread (28 messages) 28 messages, 4 authors, 2014-07-17

Re: [PATCH 05/10] sd: don't use scsi_setup_blk_pc_cmnd for write same requests

From: Christoph Hellwig <hch@lst.de>
Date: 2014-07-11 15:15:18

quoted
-	rq->__data_len = sdp->sector_size;
quoted
+	rq->__data_len = sdp->sector_size;
+	ret = scsi_init_io(cmd, GFP_ATOMIC);
+	rq->__data_len = nr_bytes;
  	return ret;
  }
Hmm? __data_len is the amount of data written _on the target_.
Do we actually care about it?
And if so, why didn't it break with the original version?
In either case a short description in the patch would be nice.
The drivers care about it, and scsi_init_io uses it as transfer size,
thus we have to set it to the tranfer length before the scsi_init_io
call, and to the full number of bytes to be written after it.

We already do this before the patch, I just moved the first assginment
next to the call to scsi_init_io so that it's more obvious.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help