Commit f5cc6898 authored by Ilya Dryomov's avatar Ilya Dryomov

libceph: use alloc_pg_mapping() in __decode_pg_upmap_items()

... otherwise we die in insert_pg_mapping(), which wants pg->node to be
empty, i.e. initialized with RB_CLEAR_NODE.

Fixes: 6f428df4 ("libceph: pg_upmap[_items] infrastructure")
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent c2acfd95
...@@ -1400,7 +1400,7 @@ static struct ceph_pg_mapping *__decode_pg_upmap_items(void **p, void *end, ...@@ -1400,7 +1400,7 @@ static struct ceph_pg_mapping *__decode_pg_upmap_items(void **p, void *end,
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
ceph_decode_need(p, end, 2 * len * sizeof(u32), e_inval); ceph_decode_need(p, end, 2 * len * sizeof(u32), e_inval);
pg = kzalloc(sizeof(*pg) + 2 * len * sizeof(u32), GFP_NOIO); pg = alloc_pg_mapping(2 * len * sizeof(u32));
if (!pg) if (!pg)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment