aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/osd_client.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/fs/ceph/osd_client.c b/fs/ceph/osd_client.c
index ffd819c5a5dd..3a631f27cc9e 100644
--- a/fs/ceph/osd_client.c
+++ b/fs/ceph/osd_client.c
@@ -615,7 +615,6 @@ static int __map_osds(struct ceph_osd_client *osdc,
615 struct ceph_pg pgid; 615 struct ceph_pg pgid;
616 int o = -1; 616 int o = -1;
617 int err; 617 int err;
618 struct ceph_osd *newosd = NULL;
619 618
620 dout("map_osds %p tid %lld\n", req, req->r_tid); 619 dout("map_osds %p tid %lld\n", req, req->r_tid);
621 err = ceph_calc_object_layout(&reqhead->layout, req->r_oid, 620 err = ceph_calc_object_layout(&reqhead->layout, req->r_oid,
@@ -639,25 +638,15 @@ static int __map_osds(struct ceph_osd_client *osdc,
639 if (req->r_osd) { 638 if (req->r_osd) {
640 __cancel_request(req); 639 __cancel_request(req);
641 list_del_init(&req->r_osd_item); 640 list_del_init(&req->r_osd_item);
642 if (list_empty(&req->r_osd->o_requests)) {
643 /* try to re-use r_osd if possible */
644 newosd = get_osd(req->r_osd);
645 __remove_osd(osdc, newosd);
646 }
647 req->r_osd = NULL; 641 req->r_osd = NULL;
648 } 642 }
649 643
650 req->r_osd = __lookup_osd(osdc, o); 644 req->r_osd = __lookup_osd(osdc, o);
651 if (!req->r_osd && o >= 0) { 645 if (!req->r_osd && o >= 0) {
652 if (newosd) { 646 err = -ENOMEM;
653 req->r_osd = newosd; 647 req->r_osd = create_osd(osdc);
654 newosd = NULL; 648 if (!req->r_osd)
655 } else { 649 goto out;
656 err = -ENOMEM;
657 req->r_osd = create_osd(osdc);
658 if (!req->r_osd)
659 goto out;
660 }
661 650
662 dout("map_osds osd %p is osd%d\n", req->r_osd, o); 651 dout("map_osds osd %p is osd%d\n", req->r_osd, o);
663 req->r_osd->o_osd = o; 652 req->r_osd->o_osd = o;
@@ -674,8 +663,6 @@ static int __map_osds(struct ceph_osd_client *osdc,
674 err = 1; /* osd changed */ 663 err = 1; /* osd changed */
675 664
676out: 665out:
677 if (newosd)
678 put_osd(newosd);
679 return err; 666 return err;
680} 667}
681 668