|
@@ -935,13 +935,9 @@ pscsi_map_sg(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
|
|
|
|
|
|
rc = bio_add_pc_page(pdv->pdv_sd->request_queue,
|
|
|
bio, page, bytes, off);
|
|
|
- if (rc != bytes)
|
|
|
- goto fail;
|
|
|
-
|
|
|
pr_debug("PSCSI: bio->bi_vcnt: %d nr_vecs: %d\n",
|
|
|
- bio->bi_vcnt, nr_vecs);
|
|
|
-
|
|
|
- if (bio->bi_vcnt > nr_vecs) {
|
|
|
+ bio_segments(bio), nr_vecs);
|
|
|
+ if (rc != bytes) {
|
|
|
pr_debug("PSCSI: Reached bio->bi_vcnt max:"
|
|
|
" %d i: %d bio: %p, allocating another"
|
|
|
" bio\n", bio->bi_vcnt, i, bio);
|