mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-13 17:28:56 +00:00
drbd: Added transmission faults to the fault injection code
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
This commit is contained in:
parent
087c24925c
commit
6b4388ac1f
@ -132,6 +132,7 @@ enum {
|
|||||||
DRBD_FAULT_DT_RA = 6, /* data read ahead */
|
DRBD_FAULT_DT_RA = 6, /* data read ahead */
|
||||||
DRBD_FAULT_BM_ALLOC = 7, /* bitmap allocation */
|
DRBD_FAULT_BM_ALLOC = 7, /* bitmap allocation */
|
||||||
DRBD_FAULT_AL_EE = 8, /* alloc ee */
|
DRBD_FAULT_AL_EE = 8, /* alloc ee */
|
||||||
|
DRBD_FAULT_RECEIVE = 9, /* Changes some bytes upon receiving a [rs]data block */
|
||||||
|
|
||||||
DRBD_FAULT_MAX,
|
DRBD_FAULT_MAX,
|
||||||
};
|
};
|
||||||
|
@ -3668,7 +3668,8 @@ _drbd_fault_str(unsigned int type) {
|
|||||||
[DRBD_FAULT_DT_RD] = "Data read",
|
[DRBD_FAULT_DT_RD] = "Data read",
|
||||||
[DRBD_FAULT_DT_RA] = "Data read ahead",
|
[DRBD_FAULT_DT_RA] = "Data read ahead",
|
||||||
[DRBD_FAULT_BM_ALLOC] = "BM allocation",
|
[DRBD_FAULT_BM_ALLOC] = "BM allocation",
|
||||||
[DRBD_FAULT_AL_EE] = "EE allocation"
|
[DRBD_FAULT_AL_EE] = "EE allocation",
|
||||||
|
[DRBD_FAULT_RECEIVE] = "receive data corruption",
|
||||||
};
|
};
|
||||||
|
|
||||||
return (type < DRBD_FAULT_MAX) ? _faults[type] : "**Unknown**";
|
return (type < DRBD_FAULT_MAX) ? _faults[type] : "**Unknown**";
|
||||||
|
@ -1270,6 +1270,7 @@ read_in_block(struct drbd_conf *mdev, u64 id, sector_t sector, int data_size) __
|
|||||||
int dgs, ds, i, rr;
|
int dgs, ds, i, rr;
|
||||||
void *dig_in = mdev->int_dig_in;
|
void *dig_in = mdev->int_dig_in;
|
||||||
void *dig_vv = mdev->int_dig_vv;
|
void *dig_vv = mdev->int_dig_vv;
|
||||||
|
unsigned long *data;
|
||||||
|
|
||||||
dgs = (mdev->agreed_pro_version >= 87 && mdev->integrity_r_tfm) ?
|
dgs = (mdev->agreed_pro_version >= 87 && mdev->integrity_r_tfm) ?
|
||||||
crypto_hash_digestsize(mdev->integrity_r_tfm) : 0;
|
crypto_hash_digestsize(mdev->integrity_r_tfm) : 0;
|
||||||
@ -1307,7 +1308,12 @@ read_in_block(struct drbd_conf *mdev, u64 id, sector_t sector, int data_size) __
|
|||||||
ds = data_size;
|
ds = data_size;
|
||||||
bio_for_each_segment(bvec, bio, i) {
|
bio_for_each_segment(bvec, bio, i) {
|
||||||
page = bvec->bv_page;
|
page = bvec->bv_page;
|
||||||
rr = drbd_recv(mdev, kmap(page), min_t(int, ds, PAGE_SIZE));
|
data = kmap(page);
|
||||||
|
rr = drbd_recv(mdev, data, min_t(int, ds, PAGE_SIZE));
|
||||||
|
if (FAULT_ACTIVE(mdev, DRBD_FAULT_RECEIVE)) {
|
||||||
|
dev_err(DEV, "Fault injection: Corrupting data on receive\n");
|
||||||
|
data[0] = data[0] ^ (unsigned long)-1;
|
||||||
|
}
|
||||||
kunmap(page);
|
kunmap(page);
|
||||||
if (rr != min_t(int, ds, PAGE_SIZE)) {
|
if (rr != min_t(int, ds, PAGE_SIZE)) {
|
||||||
drbd_free_ee(mdev, e);
|
drbd_free_ee(mdev, e);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user