]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/nvdimm/blk.c
Merge tag 'kvm-4.13-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[karo-tx-linux.git] / drivers / nvdimm / blk.c
index f12d23c49771ca95d8fdf31949ec5be2805986c6..345acca576b3c077b68e339437dd2e54ae76384a 100644 (file)
@@ -106,7 +106,8 @@ static int nd_blk_rw_integrity(struct nd_namespace_blk *nsblk,
 
                len -= cur_len;
                dev_offset += 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 err;
@@ -179,16 +180,8 @@ static blk_qc_t nd_blk_make_request(struct request_queue *q, struct bio *bio)
        int err = 0, rw;
        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;
 
        bip = bio_integrity(bio);
        nsblk = q->queuedata;
@@ -212,7 +205,6 @@ static blk_qc_t nd_blk_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;
 }