Commit 8d30abff authored by Joe Thornber's avatar Joe Thornber Committed by Mike Snitzer

dm thin: return error from alloc_data_block if pool is not in write mode

Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 7f214665
......@@ -923,6 +923,9 @@ static int alloc_data_block(struct thin_c *tc, dm_block_t *result)
if (pool->no_free_space)
return -ENOSPC;
if (get_pool_mode(pool) != PM_WRITE)
return -EINVAL;
r = dm_pool_get_free_block_count(pool->pmd, &free_blocks);
if (r)
return r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment