[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100909092906.GA21760@schmichrtp.mainz.de.ibm.com>
Date: Thu, 9 Sep 2010 11:29:06 +0200
From: Christof Schmitt <christof.schmitt@...ibm.com>
To: Anil kumar <anils_r@...oo.com>
Cc: linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org
Subject: Re: scsi_cmnd data_buffer checksum
On Thu, Sep 09, 2010 at 02:09:28AM -0700, Anil kumar wrote:
> I quickly tried copying the data buffer to local buffers as follows:
>
> In Queuecommand:
>
> cmd->local_write_buf = pci_alloc_consistent(...);
> cmd->write_buf = (u8 *)(kmap_atomic(sg->page, KM_IRQ0) + sg->offset);
>
> memcpy(cmd->local_write_buf, cmd->write_buf, scsibufflen(scsi_cmnd));
>
> Now I calculate checksums of cmd->write_buf and my local cmd->local_write_buf
>
> and the checksum fails. Am I doing something wrong here?
Are you only copying one element of the sg list? Are you sure that
there is only one element? If not, you have to use something like
scsi_kmap_atomic_sg and create a copy of each element (maybe use
scsi_for_each_sg).
Or maybe there is another problem... hard to guess from the distance.
Christof
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists