libceph: fix crush_decode() for older maps
authorIlya Dryomov <idryomov@gmail.com>
Tue, 28 Feb 2017 17:53:53 +0000 (18:53 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 7 Mar 2017 13:30:37 +0000 (14:30 +0100)
Older (shorter) CRUSH maps too need to be finalized.

Fixes: 66a0e2d579db ("crush: remove mutable part of CRUSH map")
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
net/ceph/osdmap.c

index 6824c0ec8373e721ac9ca2d837f488ff22233e1f..cc22dd282a3e0b90b21056a527dd67b5849c6125 100644 (file)
@@ -390,9 +390,8 @@ static struct crush_map *crush_decode(void *pbyval, void *end)
        dout("crush decode tunable chooseleaf_stable = %d\n",
             c->chooseleaf_stable);
 
-       crush_finalize(c);
-
 done:
+       crush_finalize(c);
        dout("crush_decode success\n");
        return c;