]> git.baikalelectronics.ru Git - kernel.git/commit
dm thin: consistently return -ENOSPC if pool has run out of data space
authorMike Snitzer <snitzer@redhat.com>
Thu, 10 Mar 2016 16:31:35 +0000 (11:31 -0500)
committerMike Snitzer <snitzer@redhat.com>
Fri, 11 Mar 2016 21:15:22 +0000 (16:15 -0500)
commit7abc6aec597d3241ad958e858ed664d8cb714801
treef12fa8cf089e8cccb124731ec5c614a5707b7a8a
parent7fa837fc6528790615f373198fc8670356d1b95e
dm thin: consistently return -ENOSPC if pool has run out of data space

Commit 869fe20c48 ("dm thin: return -ENOSPC when erroring retry list due
to out of data space") was a step in the right direction but didn't go
far enough.

Add a new 'out_of_data_space' flag to 'struct pool' and set it if/when
the pool runs of of data space.  This fixes cell_error() and
error_retry_list() to not blindly return -EIO.

We cannot rely on the 'error_if_no_space' feature flag since it is
transient (in that it can be reset once space is added, plus it only
controls whether errors are issued, it doesn't reflect whether the
pool is actually out of space).

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-thin.c