diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2017-06-15 16:30:55 +0200 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2017-07-07 17:25:17 +0200 |
commit | 6d637a540e6f87b9c926d45a507ff143640517cf (patch) | |
tree | c7201d07e4245e95a7457005841b3ec18fc71a7b /net/ceph/osd_client.c | |
parent | db098ec4e41a6ad8f5b248b1287bb583754e944e (diff) | |
download | linux-6d637a540e6f87b9c926d45a507ff143640517cf.tar.gz linux-6d637a540e6f87b9c926d45a507ff143640517cf.tar.bz2 linux-6d637a540e6f87b9c926d45a507ff143640517cf.zip |
libceph: use target pi for calc_target() calculations
For luminous and beyond we are encoding the actual spgid, which
requires operating with the correct pg_num, i.e. that of the target
pool.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'net/ceph/osd_client.c')
-rw-r--r-- | net/ceph/osd_client.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index c050e28d3c97..ce0055dc7544 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -1306,7 +1306,7 @@ static bool target_should_be_paused(struct ceph_osd_client *osdc, ceph_osdmap_flag(osdc, CEPH_OSDMAP_FULL) || __pool_full(pi); - WARN_ON(pi->id != t->base_oloc.pool); + WARN_ON(pi->id != t->target_oloc.pool); return ((t->flags & CEPH_OSD_FLAG_READ) && pauserd) || ((t->flags & CEPH_OSD_FLAG_WRITE) && pausewr) || (osdc->osdmap->epoch < osdc->epoch_barrier); @@ -1359,6 +1359,13 @@ static enum calc_target_result calc_target(struct ceph_osd_client *osdc, t->target_oloc.pool = pi->read_tier; if (t->flags & CEPH_OSD_FLAG_WRITE && pi->write_tier >= 0) t->target_oloc.pool = pi->write_tier; + + pi = ceph_pg_pool_by_id(osdc->osdmap, t->target_oloc.pool); + if (!pi) { + t->osd = CEPH_HOMELESS_OSD; + ct_res = CALC_TARGET_POOL_DNE; + goto out; + } } ret = ceph_object_locator_to_pg(osdc->osdmap, &t->target_oid, |