diff options
-rw-r--r-- | net/ceph/osdmap.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c index df9389ddd56c..20a38a37794c 100644 --- a/net/ceph/osdmap.c +++ b/net/ceph/osdmap.c | |||
@@ -1597,7 +1597,7 @@ static int raw_to_up_osds(struct ceph_osdmap *osdmap, | |||
1597 | } | 1597 | } |
1598 | 1598 | ||
1599 | /* | 1599 | /* |
1600 | * Given up set, apply pg_temp mapping. | 1600 | * Given up set, apply pg_temp and primary_temp mappings. |
1601 | * | 1601 | * |
1602 | * Return acting set length. *primary is set to acting primary osd id, | 1602 | * Return acting set length. *primary is set to acting primary osd id, |
1603 | * or -1 if acting set is empty. | 1603 | * or -1 if acting set is empty. |
@@ -1644,6 +1644,11 @@ static int apply_temps(struct ceph_osdmap *osdmap, | |||
1644 | temp_primary = *primary; | 1644 | temp_primary = *primary; |
1645 | } | 1645 | } |
1646 | 1646 | ||
1647 | /* primary_temp? */ | ||
1648 | pg = __lookup_pg_mapping(&osdmap->primary_temp, pgid); | ||
1649 | if (pg) | ||
1650 | temp_primary = pg->primary_temp.osd; | ||
1651 | |||
1647 | *primary = temp_primary; | 1652 | *primary = temp_primary; |
1648 | return temp_len; | 1653 | return temp_len; |
1649 | } | 1654 | } |