b=13635
i=adilger
i=shadow
Add opc parameter to osc_checksum_bulk.
}
static obd_count osc_checksum_bulk(int nob, obd_count pg_count,
}
static obd_count osc_checksum_bulk(int nob, obd_count pg_count,
+ struct brw_page **pga, int opc)
{
__u32 cksum = ~0;
int i = 0;
{
__u32 cksum = ~0;
int i = 0;
/* corrupt the data before we compute the checksum, to
* simulate an OST->client data error */
/* corrupt the data before we compute the checksum, to
* simulate an OST->client data error */
+ if (i == 0 && opc == OST_READ &&
OBD_FAIL_CHECK_ONCE(OBD_FAIL_OSC_CHECKSUM_RECEIVE))
memcpy(ptr + off, "bad1", min(4, nob));
cksum = crc32_le(cksum, ptr + off, count);
OBD_FAIL_CHECK_ONCE(OBD_FAIL_OSC_CHECKSUM_RECEIVE))
memcpy(ptr + off, "bad1", min(4, nob));
cksum = crc32_le(cksum, ptr + off, count);
}
/* For sending we only compute the wrong checksum instead
* of corrupting the data so it is still correct on a redo */
}
/* For sending we only compute the wrong checksum instead
* of corrupting the data so it is still correct on a redo */
- if (OBD_FAIL_CHECK_ONCE(OBD_FAIL_OSC_CHECKSUM_SEND))
+ if (opc == OST_WRITE && OBD_FAIL_CHECK_ONCE(OBD_FAIL_OSC_CHECKSUM_SEND))
if (unlikely(cli->cl_checksum)) {
body->oa.o_valid |= OBD_MD_FLCKSUM;
body->oa.o_cksum = osc_checksum_bulk(requested_nob,
if (unlikely(cli->cl_checksum)) {
body->oa.o_valid |= OBD_MD_FLCKSUM;
body->oa.o_cksum = osc_checksum_bulk(requested_nob,
+ page_count, pga,
+ OST_WRITE);
CDEBUG(D_PAGE, "checksum at write origin: %x\n",
body->oa.o_cksum);
/* save this in 'oa', too, for later checking */
CDEBUG(D_PAGE, "checksum at write origin: %x\n",
body->oa.o_cksum);
/* save this in 'oa', too, for later checking */
- new_cksum = osc_checksum_bulk(nob, page_count, pga);
+ new_cksum = osc_checksum_bulk(nob, page_count, pga, OST_WRITE);
if (new_cksum == server_cksum)
msg = "changed on the client after we checksummed it - "
if (new_cksum == server_cksum)
msg = "changed on the client after we checksummed it - "
char *router;
client_cksum = osc_checksum_bulk(rc, aa->aa_page_count,
char *router;
client_cksum = osc_checksum_bulk(rc, aa->aa_page_count,
+ aa->aa_ppga, OST_READ);
if (peer->nid == req->rq_bulk->bd_sender) {
via = router = "";
if (peer->nid == req->rq_bulk->bd_sender) {
via = router = "";