aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/objlayout/objio_osd.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/objlayout/objio_osd.c')
-rw-r--r--fs/nfs/objlayout/objio_osd.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c
index aa8663a8938..d0cda12fddc 100644
--- a/fs/nfs/objlayout/objio_osd.c
+++ b/fs/nfs/objlayout/objio_osd.c
@@ -479,7 +479,6 @@ static int _io_check(struct objio_state *ios, bool is_write)
479 for (i = 0; i < ios->numdevs; i++) { 479 for (i = 0; i < ios->numdevs; i++) {
480 struct osd_sense_info osi; 480 struct osd_sense_info osi;
481 struct osd_request *or = ios->per_dev[i].or; 481 struct osd_request *or = ios->per_dev[i].or;
482 unsigned dev;
483 int ret; 482 int ret;
484 483
485 if (!or) 484 if (!or)
@@ -500,9 +499,8 @@ static int _io_check(struct objio_state *ios, bool is_write)
500 499
501 continue; /* we recovered */ 500 continue; /* we recovered */
502 } 501 }
503 dev = ios->per_dev[i].dev; 502 objlayout_io_set_result(&ios->ol_state, i,
504 objlayout_io_set_result(&ios->ol_state, dev, 503 &ios->layout->comps[i].oc_object_id,
505 &ios->layout->comps[dev].oc_object_id,
506 osd_pri_2_pnfs_err(osi.osd_err_pri), 504 osd_pri_2_pnfs_err(osi.osd_err_pri),
507 ios->per_dev[i].offset, 505 ios->per_dev[i].offset,
508 ios->per_dev[i].length, 506 ios->per_dev[i].length,
@@ -648,7 +646,7 @@ static int _prepare_one_group(struct objio_state *ios, u64 length,
648 int ret = 0; 646 int ret = 0;
649 647
650 while (length) { 648 while (length) {
651 struct _objio_per_comp *per_dev = &ios->per_dev[dev]; 649 struct _objio_per_comp *per_dev = &ios->per_dev[dev - first_dev];
652 unsigned cur_len, page_off = 0; 650 unsigned cur_len, page_off = 0;
653 651
654 if (!per_dev->length) { 652 if (!per_dev->length) {
@@ -668,8 +666,8 @@ static int _prepare_one_group(struct objio_state *ios, u64 length,
668 cur_len = stripe_unit; 666 cur_len = stripe_unit;
669 } 667 }
670 668
671 if (max_comp < dev) 669 if (max_comp < dev - first_dev)
672 max_comp = dev; 670 max_comp = dev - first_dev;
673 } else { 671 } else {
674 cur_len = stripe_unit; 672 cur_len = stripe_unit;
675 } 673 }
@@ -804,7 +802,7 @@ static int _read_mirrors(struct objio_state *ios, unsigned cur_comp)
804 struct _objio_per_comp *per_dev = &ios->per_dev[cur_comp]; 802 struct _objio_per_comp *per_dev = &ios->per_dev[cur_comp];
805 unsigned dev = per_dev->dev; 803 unsigned dev = per_dev->dev;
806 struct pnfs_osd_object_cred *cred = 804 struct pnfs_osd_object_cred *cred =
807 &ios->layout->comps[dev]; 805 &ios->layout->comps[cur_comp];
808 struct osd_obj_id obj = { 806 struct osd_obj_id obj = {
809 .partition = cred->oc_object_id.oid_partition_id, 807 .partition = cred->oc_object_id.oid_partition_id,
810 .id = cred->oc_object_id.oid_object_id, 808 .id = cred->oc_object_id.oid_object_id,
@@ -902,7 +900,7 @@ static int _write_mirrors(struct objio_state *ios, unsigned cur_comp)
902 for (; cur_comp < last_comp; ++cur_comp, ++dev) { 900 for (; cur_comp < last_comp; ++cur_comp, ++dev) {
903 struct osd_request *or = NULL; 901 struct osd_request *or = NULL;
904 struct pnfs_osd_object_cred *cred = 902 struct pnfs_osd_object_cred *cred =
905 &ios->layout->comps[dev]; 903 &ios->layout->comps[cur_comp];
906 struct osd_obj_id obj = { 904 struct osd_obj_id obj = {
907 .partition = cred->oc_object_id.oid_partition_id, 905 .partition = cred->oc_object_id.oid_partition_id,
908 .id = cred->oc_object_id.oid_object_id, 906 .id = cred->oc_object_id.oid_object_id,