On 06/04/2011 07:21 AM, Christoph Hellwig wrote: > On Fri, Jun 03, 2011 at 06:18:12PM -0700, Nicholas A. Bellinger wrote: >> From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx> >> >> This patch changes iscsit_alloc_buffs() w/ SCF_SCSI_CONTROL_NONSG_IO_CDB >> to take into account the offset_in_page(), and also handles the case >> where length and PAGE_SIZE are identical, and require nents to be incremented. >> >> It also moves iscsit_allocate_iovecs() for the SCSI payload case until >> after transport_generic_map_mem_to_cmd() has been called because the >> iovec allocation depends upon cmd->se_cmd.t_tasks_se_num having been >> set by the return of transport_map_sg_to_mem() done in RX thread context. > > I'd rather just remove the SCF_SCSI_CONTROL_NONSG_IO_CDB side of the > code path, and always allocate one page per S/G list item. That simplifies > the code, and fixes the issues with non-aligned kmallocs. I thought about doing that but didn't quite have the guts. It *would* simplify things a lot, though. Offsets of offsets are no fun. +1 from me. Express everything in pages and scatterlists. -- Andy -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html