Skip to content

Commit

Permalink
dm thin: return error from alloc_data_block if pool is not in write mode
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Joe Thornber authored and Mike Snitzer committed Jan 7, 2014
1 parent 7f21466 commit 8d30abf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/md/dm-thin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8d30abf

Please sign in to comment.