Commit 4b8514ee authored by Lars Ellenberg's avatar Lars Ellenberg Committed by Philipp Reisner

drbd: fix potential data corruption and protocol error

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent e8744f5a
...@@ -1729,7 +1729,7 @@ static int _drbd_send_bio(struct drbd_conf *mdev, struct bio *bio) ...@@ -1729,7 +1729,7 @@ static int _drbd_send_bio(struct drbd_conf *mdev, struct bio *bio)
struct bio_vec *bvec; struct bio_vec *bvec;
int i; int i;
/* hint all but last page with MSG_MORE */ /* 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; int err;
err = _drbd_no_send_page(mdev, bvec->bv_page, 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) ...@@ -1746,7 +1746,7 @@ static int _drbd_send_zc_bio(struct drbd_conf *mdev, struct bio *bio)
struct bio_vec *bvec; struct bio_vec *bvec;
int i; int i;
/* hint all but last page with MSG_MORE */ /* 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; int err;
err = _drbd_send_page(mdev, bvec->bv_page, err = _drbd_send_page(mdev, bvec->bv_page,
......
...@@ -304,7 +304,7 @@ void drbd_csum_bio(struct drbd_conf *mdev, struct crypto_hash *tfm, struct bio * ...@@ -304,7 +304,7 @@ void drbd_csum_bio(struct drbd_conf *mdev, struct crypto_hash *tfm, struct bio *
sg_init_table(&sg, 1); sg_init_table(&sg, 1);
crypto_hash_init(&desc); 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); sg_set_page(&sg, bvec->bv_page, bvec->bv_len, bvec->bv_offset);
crypto_hash_update(&desc, &sg, sg.length); crypto_hash_update(&desc, &sg, sg.length);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment