drbd: fix potential data corruption and protocol error
authorLars Ellenberg <lars.ellenberg@linbit.com>
Mon, 26 Mar 2012 14:12:49 +0000 (16:12 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 8 Nov 2012 15:58:19 +0000 (16:58 +0100)
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_main.c
drivers/block/drbd/drbd_worker.c

index c312a3bb936756899bb6c52cf32d77a0e3322f34..2aee581c03e2d5f08ff8dba44b1ce710abbb42cc 100644 (file)
@@ -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,
index e263a5f4aac5df1320b2b5908a60b3439af68d84..3adbc5a29702bbf2c3fa5f1938bc4e76635bfeeb 100644 (file)
@@ -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);
        }