libceph: use pg_num_mask instead of pgp_num_mask for pg.seed calc
PATCH 1/1 libceph: use pg_num_mask instead of pgp_num_mask for pg.seed calc
Fix a typo that used the wrong bitmask for the pg.seed calculation. This is normally unnoticed because in most cases pg_num == pgp_num. It is, however, a bug that is easily corrected.
Signed-off-by Sage Weil <[email protected]>
--- net/ceph/osdmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ceph/osdmap.c +1 -1
@@ -1129,7 +1129,7 @@ static int *calc_pg_raw(struct ceph_osdmap *osdmap, struct ceph_pg pgid,/* pg_temp? */ pgid.seed =ceph_stable_mod (pgid.seed, pool->pg_num, - pool->pgp_num_mask); + pool->pg_num_mask); pg =__lookup_pg_mapping (&osdmap->pg_temp, pgid);if (pg) { *num = pg->len;
Signature · 1 line
1.8.1.2
Quoted 3 lines · Sage Weil
Fix a typo that used the wrong bitmask for the pg.seed calculation. This is normally unnoticed because in most cases
pg_num==pgp_num. It is, however, a bug that is easily corrected.
Looks good to me. The other two uses of pgp_num_mask are coupled with pgp_num (not pg_num) in a ceph_stable_mod() call.
Reviewed-by Alex Elder <[email protected]>
Quoted 20 lines
Signed-off-by Sage Weil <[email protected]>--- net/ceph/osdmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/ceph/osdmap.c +1
-1@@ -1129,7 +1129,7 @@ static int *calc_pg_raw(struct ceph_osdmap *osdmap, struct ceph_pg pgid,/* pg_temp? */ pgid.seed =ceph_stable_mod (pgid.seed, pool->pg_num, - pool->pgp_num_mask); + pool->pg_num_mask); pg =__lookup_pg_mapping (&osdmap->pg_temp, pgid);if (pg) { *num = pg->len;