Skip to content

Commit

Permalink
dm thin: provide specific errors for two table load failure cases
Browse files Browse the repository at this point in the history
Provide specific error message strings for two pool_ctr() failure cases
that currently give just "Unknown error".

Reference: test_two_pools_pointing_to_the_same_metadata_fails and
test_different_pool_cant_replace_pool in thinp-test-suite.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
Mike Snitzer authored and Alasdair G Kergon committed Jul 27, 2012
1 parent 1a66a08 commit f09996c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/md/dm-thin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1828,15 +1828,19 @@ static struct pool *__pool_find(struct mapped_device *pool_md,
struct pool *pool = __pool_table_lookup_metadata_dev(metadata_dev);

if (pool) {
if (pool->pool_md != pool_md)
if (pool->pool_md != pool_md) {
*error = "metadata device already in use by a pool";
return ERR_PTR(-EBUSY);
}
__pool_inc(pool);

} else {
pool = __pool_table_lookup(pool_md);
if (pool) {
if (pool->md_dev != metadata_dev)
if (pool->md_dev != metadata_dev) {
*error = "different pool cannot replace a pool";
return ERR_PTR(-EINVAL);
}
__pool_inc(pool);

} else {
Expand Down

0 comments on commit f09996c

Please sign in to comment.