The post-hammer wip-temp branch changed hobject_t::get_min() so that pool
is INT64_MIN instead of -1 and neglected to deal with the encoding compat
with older versions. Compensate on hammer by mapping INT64_MIN to -1
locally. See commit
ff99af38df830e215359bfb8837bf310a2023a4d.
Note that this means upgrades from hammer to post-hammer *must* include
this fix prior to the upgrade. This will need to be well-documented in the
release notes.
Master gets a similar fix so that they map our min value to the new
INT64_MIN one on decode.
Fixes: #12536 (for hammer)
Signed-off-by: Sage Weil <sage@redhat.com>
if (struct_v >= 4) {
::decode(nspace, bl);
::decode(pool, bl);
+ // newer OSDs have a different hobject_t::get_min(); decode it properly.
+ if (pool == INT64_MIN &&
+ hash == 0 &&
+ snap == 0 &&
+ !max &&
+ oid.name.empty()) {
+ pool = -1;
+ assert(is_min());
+ }
}
DECODE_FINISH(bl);
build_filestore_key_cache();
if (struct_v >= 4) {
::decode(hobj.nspace, bl);
::decode(hobj.pool, bl);
+ // newer OSDs have a different hobject_t::get_min(); decode it properly.
+ if (hobj.pool == INT64_MIN &&
+ hobj.hash == 0 &&
+ hobj.snap == 0 &&
+ !hobj.max &&
+ hobj.oid.name.empty()) {
+ hobj.pool = -1;
+ assert(hobj.is_min());
+ }
}
if (struct_v >= 5) {
::decode(generation, bl);
class Formatter;
}
+#ifndef UINT64_MAX
+#define UINT64_MAX (18446744073709551615ULL)
+#endif
+#ifndef INT64_MIN
+#define INT64_MIN ((int64_t)0x8000000000000000ll)
+#endif
+
struct hobject_t {
object_t oid;
snapid_t snap;