aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-thin.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-thin.c')
-rw-r--r--drivers/md/dm-thin.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index 0bb9e646e215..e89f8e7d8a33 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -1828,15 +1828,19 @@ static struct pool *__pool_find(struct mapped_device *pool_md,
1828 struct pool *pool = __pool_table_lookup_metadata_dev(metadata_dev); 1828 struct pool *pool = __pool_table_lookup_metadata_dev(metadata_dev);
1829 1829
1830 if (pool) { 1830 if (pool) {
1831 if (pool->pool_md != pool_md) 1831 if (pool->pool_md != pool_md) {
1832 *error = "metadata device already in use by a pool";
1832 return ERR_PTR(-EBUSY); 1833 return ERR_PTR(-EBUSY);
1834 }
1833 __pool_inc(pool); 1835 __pool_inc(pool);
1834 1836
1835 } else { 1837 } else {
1836 pool = __pool_table_lookup(pool_md); 1838 pool = __pool_table_lookup(pool_md);
1837 if (pool) { 1839 if (pool) {
1838 if (pool->md_dev != metadata_dev) 1840 if (pool->md_dev != metadata_dev) {
1841 *error = "different pool cannot replace a pool";
1839 return ERR_PTR(-EINVAL); 1842 return ERR_PTR(-EINVAL);
1843 }
1840 __pool_inc(pool); 1844 __pool_inc(pool);
1841 1845
1842 } else { 1846 } else {