From: Lars Ellenberg Date: Mon, 26 Mar 2012 14:12:49 +0000 (+0200) Subject: drbd: fix potential data corruption and protocol error X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4b8514ee288dede5013d23c3d6a285052d8392ab;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drbd: fix potential data corruption and protocol error Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index c312a3bb9367..2aee581c03e2 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -1729,7 +1729,7 @@ static int _drbd_send_bio(struct drbd_conf *mdev, struct bio *bio) struct bio_vec *bvec; int i; /* hint all but last page with MSG_MORE */ - __bio_for_each_segment(bvec, bio, i, 0) { + bio_for_each_segment(bvec, bio, i) { int err; err = _drbd_no_send_page(mdev, bvec->bv_page, @@ -1746,7 +1746,7 @@ static int _drbd_send_zc_bio(struct drbd_conf *mdev, struct bio *bio) struct bio_vec *bvec; int i; /* hint all but last page with MSG_MORE */ - __bio_for_each_segment(bvec, bio, i, 0) { + bio_for_each_segment(bvec, bio, i) { int err; err = _drbd_send_page(mdev, bvec->bv_page, diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index e263a5f4aac5..3adbc5a29702 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c @@ -304,7 +304,7 @@ void drbd_csum_bio(struct drbd_conf *mdev, struct crypto_hash *tfm, struct bio * sg_init_table(&sg, 1); crypto_hash_init(&desc); - __bio_for_each_segment(bvec, bio, i, 0) { + bio_for_each_segment(bvec, bio, i) { sg_set_page(&sg, bvec->bv_page, bvec->bv_len, bvec->bv_offset); crypto_hash_update(&desc, &sg, sg.length); }