Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;