提交 f09996c9 编写于 作者: M Mike Snitzer 提交者: Alasdair G Kergon

dm thin: provide specific errors for two table load failure cases

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: NMike Snitzer <snitzer@redhat.com>
Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
上级 1a66a08a
...@@ -1828,15 +1828,19 @@ static struct pool *__pool_find(struct mapped_device *pool_md, ...@@ -1828,15 +1828,19 @@ static struct pool *__pool_find(struct mapped_device *pool_md,
struct pool *pool = __pool_table_lookup_metadata_dev(metadata_dev); struct pool *pool = __pool_table_lookup_metadata_dev(metadata_dev);
if (pool) { 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); return ERR_PTR(-EBUSY);
}
__pool_inc(pool); __pool_inc(pool);
} else { } else {
pool = __pool_table_lookup(pool_md); pool = __pool_table_lookup(pool_md);
if (pool) { 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); return ERR_PTR(-EINVAL);
}
__pool_inc(pool); __pool_inc(pool);
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册