diff options
author | Sage Weil <sage@inktank.com> | 2012-05-21 12:45:23 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2012-05-21 23:40:42 -0400 |
commit | 6bd9adbdf9ca6a052b0b7455ac67b925eb38cfad (patch) | |
tree | 61d254846558e23906bbef993092cf372f641509 /net/ceph/osdmap.c | |
parent | 35f9f8a09e1e88e31bd34a1e645ca0e5f070dd5c (diff) |
libceph: fix pg_temp updates
Usually, we are adding pg_temp entries or removing them. Occasionally they
update. In that case, osdmap_apply_incremental() was failing because the
rbtree entry already exists.
Fix by removing the existing entry before inserting a new one.
Fixes http://tracker.newdream.net/issues/2446
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Alex Elder <elder@inktank.com>
Diffstat (limited to 'net/ceph/osdmap.c')
-rw-r--r-- | net/ceph/osdmap.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c index 2592f3cca987..1892c523c43c 100644 --- a/net/ceph/osdmap.c +++ b/net/ceph/osdmap.c | |||
@@ -883,8 +883,12 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end, | |||
883 | pglen = ceph_decode_32(p); | 883 | pglen = ceph_decode_32(p); |
884 | 884 | ||
885 | if (pglen) { | 885 | if (pglen) { |
886 | /* insert */ | ||
887 | ceph_decode_need(p, end, pglen*sizeof(u32), bad); | 886 | ceph_decode_need(p, end, pglen*sizeof(u32), bad); |
887 | |||
888 | /* removing existing (if any) */ | ||
889 | (void) __remove_pg_mapping(&map->pg_temp, pgid); | ||
890 | |||
891 | /* insert */ | ||
888 | pg = kmalloc(sizeof(*pg) + sizeof(u32)*pglen, GFP_NOFS); | 892 | pg = kmalloc(sizeof(*pg) + sizeof(u32)*pglen, GFP_NOFS); |
889 | if (!pg) { | 893 | if (!pg) { |
890 | err = -ENOMEM; | 894 | err = -ENOMEM; |