Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359570
b: refs/heads/master
c: 4fb5d67
h: refs/heads/master
v: v3
  • Loading branch information
Alex Elder authored and Alex Elder committed Jan 17, 2013
1 parent d094492 commit 6d4b962
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 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: 06ecc6cbf7a60cd5abd9fd2bda8ae69b395c2be3
refs/heads/master: 4fb5d671399e83d3875593db2f56d5b57fcb104f
24 changes: 16 additions & 8 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3244,8 +3244,10 @@ static int rbd_add_parse_args(const char *buf,
/* The first four tokens are required */

len = next_token(&buf);
if (!len)
return -EINVAL; /* Missing monitor address(es) */
if (!len) {
rbd_warn(NULL, "no monitor address(es) provided");
return -EINVAL;
}
mon_addrs = buf;
mon_addrs_size = len + 1;
buf += len;
Expand All @@ -3254,8 +3256,10 @@ static int rbd_add_parse_args(const char *buf,
options = dup_token(&buf, NULL);
if (!options)
return -ENOMEM;
if (!*options)
goto out_err; /* Missing options */
if (!*options) {
rbd_warn(NULL, "no options provided");
goto out_err;
}

spec = rbd_spec_alloc();
if (!spec)
Expand All @@ -3264,14 +3268,18 @@ static int rbd_add_parse_args(const char *buf,
spec->pool_name = dup_token(&buf, NULL);
if (!spec->pool_name)
goto out_mem;
if (!*spec->pool_name)
goto out_err; /* Missing pool name */
if (!*spec->pool_name) {
rbd_warn(NULL, "no pool name provided");
goto out_err;
}

spec->image_name = dup_token(&buf, NULL);
if (!spec->image_name)
goto out_mem;
if (!*spec->image_name)
goto out_err; /* Missing image name */
if (!*spec->image_name) {
rbd_warn(NULL, "no image name provided");
goto out_err;
}

/*
* Snapshot name is optional; default is to use "-"
Expand Down

0 comments on commit 6d4b962

Please sign in to comment.