Skip to content

Commit

Permalink
dm thin: allow metadata commit if pool is in PM_OUT_OF_DATA_SPACE mode
Browse files Browse the repository at this point in the history
Commit 3e1a069 ("dm thin: fix out of data space handling") introduced
a regression in the metadata commit() method by returning an error if
the pool is in PM_OUT_OF_DATA_SPACE mode.  This oversight caused a thin
device to return errors even if the default queue_if_no_space ENOSPC
handling mode is used.

Fix commit() to only fail if pool is in PM_READ_ONLY or PM_FAIL mode.

Reported-by: qindehua@163.com
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org # 3.14+
  • Loading branch information
Joe Thornber authored and Mike Snitzer committed May 14, 2014
1 parent 610f2de commit 8d07e8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/dm-thin.c
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ static int commit(struct pool *pool)
{
int r;

if (get_pool_mode(pool) != PM_WRITE)
if (get_pool_mode(pool) >= PM_READ_ONLY)
return -EINVAL;

r = dm_pool_commit_metadata(pool->pmd);
Expand Down

0 comments on commit 8d07e8a

Please sign in to comment.