diff options
author | Sage Weil <sage@newdream.net> | 2010-03-17 10:05:28 -0700 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-03-23 07:46:57 -0700 |
commit | efd7576b2392cc5a0934352936d793e8884c46bf (patch) | |
tree | 4a45863267977b47b6e712987119af8a0a9a8581 /fs | |
parent | 80fc7314a7e26e8d2e4ba5b3d8cc2d4aeb750015 (diff) | |
download | kernel_samsung_tuna-efd7576b2392cc5a0934352936d793e8884c46bf.zip kernel_samsung_tuna-efd7576b2392cc5a0934352936d793e8884c46bf.tar.gz kernel_samsung_tuna-efd7576b2392cc5a0934352936d793e8884c46bf.tar.bz2 |
ceph: fix pg pool decoding from incremental osdmap update
The incremental map decoding of pg pool updates wasn't skipping
the snaps and removed_snaps vectors. This caused osd requests
to stall when pool snapshots were created or fs snapshots were
deleted. Use a common helper for full and incremental map
decoders that decodes pools properly.
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/osdmap.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/ceph/osdmap.c b/fs/ceph/osdmap.c index b83f269..d82fe87 100644 --- a/fs/ceph/osdmap.c +++ b/fs/ceph/osdmap.c @@ -480,6 +480,14 @@ static struct ceph_pg_pool_info *__lookup_pg_pool(struct rb_root *root, int id) return NULL; } +void __decode_pool(void **p, struct ceph_pg_pool_info *pi) +{ + ceph_decode_copy(p, &pi->v, sizeof(pi->v)); + calc_pg_masks(pi); + *p += le32_to_cpu(pi->v.num_snaps) * sizeof(u64); + *p += le32_to_cpu(pi->v.num_removed_snap_intervals) * sizeof(u64) * 2; +} + /* * decode a full map. */ @@ -526,12 +534,8 @@ struct ceph_osdmap *osdmap_decode(void **p, void *end) ev, CEPH_PG_POOL_VERSION); goto bad; } - ceph_decode_copy(p, &pi->v, sizeof(pi->v)); + __decode_pool(p, pi); __insert_pg_pool(&map->pg_pools, pi); - calc_pg_masks(pi); - *p += le32_to_cpu(pi->v.num_snaps) * sizeof(u64); - *p += le32_to_cpu(pi->v.num_removed_snap_intervals) - * sizeof(u64) * 2; } ceph_decode_32_safe(p, end, map->pool_max, bad); @@ -714,8 +718,7 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end, pi->id = pool; __insert_pg_pool(&map->pg_pools, pi); } - ceph_decode_copy(p, &pi->v, sizeof(pi->v)); - calc_pg_masks(pi); + __decode_pool(p, pi); } /* old_pool */ |