Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 375260
b: refs/heads/master
c: 5d0db96
h: refs/heads/master
v: v3
  • Loading branch information
Joe Thornber authored and Alasdair G Kergon committed May 10, 2013
1 parent 1e43948 commit 73a1389
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 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: b17446df2ebcaf32889376d90f4b9b2baebb2db6
refs/heads/master: 5d0db96d13a4e2cd22b52494fb19ce5a9c8b8d90
25 changes: 14 additions & 11 deletions trunk/drivers/md/dm-thin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1945,6 +1945,7 @@ static int pool_ctr(struct dm_target *ti, unsigned argc, char **argv)
unsigned long block_size;
dm_block_t low_water_blocks;
struct dm_dev *metadata_dev;
fmode_t metadata_mode;

/*
* FIXME Remove validation from scope of lock.
Expand All @@ -1956,10 +1957,22 @@ static int pool_ctr(struct dm_target *ti, unsigned argc, char **argv)
r = -EINVAL;
goto out_unlock;
}

as.argc = argc;
as.argv = argv;

r = dm_get_device(ti, argv[0], FMODE_READ | FMODE_WRITE, &metadata_dev);
/*
* Set default pool features.
*/
pool_features_init(&pf);

dm_consume_args(&as, 4);
r = parse_pool_features(&as, &pf, ti);
if (r)
goto out_unlock;

metadata_mode = FMODE_READ | ((pf.mode == PM_READ_ONLY) ? 0 : FMODE_WRITE);
r = dm_get_device(ti, argv[0], metadata_mode, &metadata_dev);
if (r) {
ti->error = "Error opening metadata block device";
goto out_unlock;
Expand Down Expand Up @@ -1992,16 +2005,6 @@ static int pool_ctr(struct dm_target *ti, unsigned argc, char **argv)
goto out;
}

/*
* Set default pool features.
*/
pool_features_init(&pf);

dm_consume_args(&as, 4);
r = parse_pool_features(&as, &pf, ti);
if (r)
goto out;

pt = kzalloc(sizeof(*pt), GFP_KERNEL);
if (!pt) {
r = -ENOMEM;
Expand Down

0 comments on commit 73a1389

Please sign in to comment.