]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/nvdimm/btt.c
Merge tag 'kvm-4.13-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[karo-tx-linux.git] / drivers / nvdimm / btt.c
index 64216dea5278479f3ada0935d68822d9626ba1af..14323faf8bd96fbeacc6a55dc6733553a53e1c68 100644 (file)
@@ -985,7 +985,8 @@ static int btt_rw_integrity(struct btt *btt, struct bio_integrity_payload *bip,
 
                len -= cur_len;
                meta_nsoff += cur_len;
-               bvec_iter_advance(bip->bip_vec, &bip->bip_iter, cur_len);
+               if (!bvec_iter_advance(bip->bip_vec, &bip->bip_iter, cur_len))
+                       return -EIO;
        }
 
        return ret;
@@ -1203,16 +1204,8 @@ static blk_qc_t btt_make_request(struct request_queue *q, struct bio *bio)
        int err = 0;
        bool do_acct;
 
-       /*
-        * bio_integrity_enabled also checks if the bio already has an
-        * integrity payload attached. If it does, we *don't* do a
-        * bio_integrity_prep here - the payload has been generated by
-        * another kernel subsystem, and we just pass it through.
-        */
-       if (bio_integrity_enabled(bio) && bio_integrity_prep(bio)) {
-               bio->bi_status = BLK_STS_IOERR;
-               goto out;
-       }
+       if (!bio_integrity_prep(bio))
+               return BLK_QC_T_NONE;
 
        do_acct = nd_iostat_start(bio, &start);
        bio_for_each_segment(bvec, bio, iter) {
@@ -1239,7 +1232,6 @@ static blk_qc_t btt_make_request(struct request_queue *q, struct bio *bio)
        if (do_acct)
                nd_iostat_end(bio, start);
 
-out:
        bio_endio(bio);
        return BLK_QC_T_NONE;
 }