If you data pool was pool 0, this was transforming
that to -1 unconditionally, which broke upgrades. We
only want do that for a fully zeroed ceph_file_layout,
so that it still maps to a file_layout_t. If any fields
are set, though, we trust the fl_pgpool to be a valid
pool.
Signed-off-by: Sage Weil <sage@redhat.com>
stripe_count = fl.fl_stripe_count;
object_size = fl.fl_object_size;
pool_id = (int32_t)fl.fl_pg_pool;
- // in the legacy encoding, pool 0 was undefined.
- if (pool_id == 0)
+ // in the legacy encoding, a zeroed structure was the default and
+ // would have pool 0 instead of -1.
+ if (pool_id == 0 && stripe_unit == 0 && stripe_count == 0 && object_size == 0)
pool_id = -1;
pool_ns.clear();
}