Skip to content

Commit

Permalink
libceph: fix pg_temp updates
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sage Weil committed May 22, 2012
1 parent 35f9f8a commit 6bd9adb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/ceph/osdmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,8 +883,12 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
pglen = ceph_decode_32(p);

if (pglen) {
/* insert */
ceph_decode_need(p, end, pglen*sizeof(u32), bad);

/* removing existing (if any) */
(void) __remove_pg_mapping(&map->pg_temp, pgid);

/* insert */
pg = kmalloc(sizeof(*pg) + sizeof(u32)*pglen, GFP_NOFS);
if (!pg) {
err = -ENOMEM;
Expand Down

0 comments on commit 6bd9adb

Please sign in to comment.