Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188662
b: refs/heads/master
c: 30dc638
h: refs/heads/master
v: v3
  • Loading branch information
Sage Weil committed Dec 22, 2009
1 parent 34fd743 commit f531ae4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5de7bf8afa87f75af5ef3d6f9fce3e171cac834c
refs/heads/master: 30dc6381bbac213987be6fe0b0fb89868ff1f2c0
2 changes: 2 additions & 0 deletions trunk/fs/ceph/osd_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,7 @@ void ceph_osdc_handle_map(struct ceph_osd_client *osdc, struct ceph_msg *msg)
err = PTR_ERR(newmap);
goto bad;
}
BUG_ON(!newmap);
if (newmap != osdc->osdmap) {
ceph_osdmap_destroy(osdc->osdmap);
osdc->osdmap = newmap;
Expand Down Expand Up @@ -946,6 +947,7 @@ void ceph_osdc_handle_map(struct ceph_osd_client *osdc, struct ceph_msg *msg)
err = PTR_ERR(newmap);
goto bad;
}
BUG_ON(!newmap);
oldmap = osdc->osdmap;
osdc->osdmap = newmap;
if (oldmap)
Expand Down
11 changes: 6 additions & 5 deletions trunk/fs/ceph/osdmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ static struct crush_map *crush_decode(void *pbyval, void *end)
size = sizeof(struct crush_bucket_straw);
break;
default:
err = -EINVAL;
goto bad;
}
BUG_ON(size == 0);
Expand Down Expand Up @@ -278,6 +279,7 @@ static struct crush_map *crush_decode(void *pbyval, void *end)
/* len */
ceph_decode_32_safe(p, end, yes, bad);
#if BITS_PER_LONG == 32
err = -EINVAL;
if (yes > ULONG_MAX / sizeof(struct crush_rule_step))
goto bad;
#endif
Expand Down Expand Up @@ -489,11 +491,10 @@ struct ceph_osdmap *osdmap_decode(void **p, void *end)
ceph_decode_copy(p, &pgid, sizeof(pgid));
n = ceph_decode_32(p);
ceph_decode_need(p, end, n * sizeof(u32), bad);
err = -ENOMEM;
pg = kmalloc(sizeof(*pg) + n*sizeof(u32), GFP_NOFS);
if (!pg) {
err = -ENOMEM;
if (!pg)
goto bad;
}
pg->pgid = pgid;
pg->len = n;
for (j = 0; j < n; j++)
Expand Down Expand Up @@ -564,8 +565,7 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
if (len > 0) {
dout("apply_incremental full map len %d, %p to %p\n",
len, *p, end);
newmap = osdmap_decode(p, min(*p+len, end));
return newmap; /* error or not */
return osdmap_decode(p, min(*p+len, end));
}

/* new crush? */
Expand Down Expand Up @@ -809,6 +809,7 @@ int ceph_calc_object_layout(struct ceph_object_layout *ol,
struct ceph_pg_pool_info *pool;
unsigned ps;

BUG_ON(!osdmap);
if (poolid >= osdmap->num_pools)
return -EIO;

Expand Down

0 comments on commit f531ae4

Please sign in to comment.