aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/osdmap.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c
index 07fa3697ea12..11649101a4a8 100644
--- a/net/ceph/osdmap.c
+++ b/net/ceph/osdmap.c
@@ -706,7 +706,9 @@ static int osdmap_decode(void **p, void *end, struct ceph_osdmap *map)
706 goto e_inval; 706 goto e_inval;
707 } 707 }
708 708
709 ceph_decode_need(p, end, 2*sizeof(u64)+6*sizeof(u32), e_inval); 709 /* fsid, epoch, created, modified */
710 ceph_decode_need(p, end, sizeof(map->fsid) + sizeof(u32) +
711 sizeof(map->created) + sizeof(map->modified), e_inval);
710 ceph_decode_copy(p, &map->fsid, sizeof(map->fsid)); 712 ceph_decode_copy(p, &map->fsid, sizeof(map->fsid));
711 epoch = map->epoch = ceph_decode_32(p); 713 epoch = map->epoch = ceph_decode_32(p);
712 ceph_decode_copy(p, &map->created, sizeof(map->created)); 714 ceph_decode_copy(p, &map->created, sizeof(map->created));
@@ -878,8 +880,9 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
878 goto e_inval; 880 goto e_inval;
879 } 881 }
880 882
881 ceph_decode_need(p, end, sizeof(fsid)+sizeof(modified)+2*sizeof(u32), 883 /* fsid, epoch, modified, new_pool_max, new_flags */
882 e_inval); 884 ceph_decode_need(p, end, sizeof(fsid) + sizeof(u32) + sizeof(modified) +
885 sizeof(u64) + sizeof(u32), e_inval);
883 ceph_decode_copy(p, &fsid, sizeof(fsid)); 886 ceph_decode_copy(p, &fsid, sizeof(fsid));
884 epoch = ceph_decode_32(p); 887 epoch = ceph_decode_32(p);
885 BUG_ON(epoch != map->epoch+1); 888 BUG_ON(epoch != map->epoch+1);
@@ -913,10 +916,8 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
913 if (new_pool_max >= 0) 916 if (new_pool_max >= 0)
914 map->pool_max = new_pool_max; 917 map->pool_max = new_pool_max;
915 918
916 ceph_decode_need(p, end, 5*sizeof(u32), e_inval);
917
918 /* new max? */ 919 /* new max? */
919 max = ceph_decode_32(p); 920 ceph_decode_32_safe(p, end, max, e_inval);
920 if (max >= 0) { 921 if (max >= 0) {
921 err = osdmap_set_max_osd(map, max); 922 err = osdmap_set_max_osd(map, max);
922 if (err) 923 if (err)