Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347613
b: refs/heads/master
c: 2fd82b9
h: refs/heads/master
i:
  347611: 9efd01d
v: v3
  • Loading branch information
Alex Elder committed Dec 17, 2012
1 parent a220a3c commit 1848bd8
Show file tree
Hide file tree
Showing 3 changed files with 4 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: 685a7555ca69030739ddb57a47f0ea8ea80196a4
refs/heads/master: 2fd82b9e92c2a718ae81fc987b4468ceeee6979b
6 changes: 3 additions & 3 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,13 +740,13 @@ static char *rbd_segment_name(struct rbd_device *rbd_dev, u64 offset)
u64 segment;
int ret;

name = kmalloc(RBD_MAX_SEG_NAME_LEN + 1, GFP_NOIO);
name = kmalloc(MAX_OBJ_NAME_SIZE + 1, GFP_NOIO);
if (!name)
return NULL;
segment = offset >> rbd_dev->header.obj_order;
ret = snprintf(name, RBD_MAX_SEG_NAME_LEN, "%s.%012llx",
ret = snprintf(name, MAX_OBJ_NAME_SIZE + 1, "%s.%012llx",
rbd_dev->header.object_prefix, segment);
if (ret < 0 || ret >= RBD_MAX_SEG_NAME_LEN) {
if (ret < 0 || ret > MAX_OBJ_NAME_SIZE) {
pr_err("error formatting segment name for #%llu (%d)\n",
segment, ret);
kfree(name);
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/block/rbd_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
#define RBD_MIN_OBJ_ORDER 16
#define RBD_MAX_OBJ_ORDER 30

#define RBD_MAX_SEG_NAME_LEN 128

#define RBD_COMP_NONE 0
#define RBD_CRYPT_NONE 0

Expand Down

0 comments on commit 1848bd8

Please sign in to comment.