diff options
author | Mike Snitzer <snitzer@redhat.com> | 2015-07-21 13:20:46 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2015-07-26 17:39:19 -0400 |
commit | 0a927c2f02a2437a57679527e42ab7cbfa14efb1 (patch) | |
tree | 8f183be070a38128a229e6de03be47d6e03977ac | |
parent | cbfe8fa6cd672011c755c3cd85c9ffd4e2d10a6f (diff) |
dm thin: return -ENOSPC when erroring retry list due to out of data space
Otherwise -EIO would be returned when -ENOSPC should be used
consistently.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
-rw-r--r-- | drivers/md/dm-thin.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 1c50c580215c..d2bbe8cc1e97 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c | |||
@@ -666,16 +666,21 @@ static void requeue_io(struct thin_c *tc) | |||
666 | requeue_deferred_cells(tc); | 666 | requeue_deferred_cells(tc); |
667 | } | 667 | } |
668 | 668 | ||
669 | static void error_retry_list(struct pool *pool) | 669 | static void error_retry_list_with_code(struct pool *pool, int error) |
670 | { | 670 | { |
671 | struct thin_c *tc; | 671 | struct thin_c *tc; |
672 | 672 | ||
673 | rcu_read_lock(); | 673 | rcu_read_lock(); |
674 | list_for_each_entry_rcu(tc, &pool->active_thins, list) | 674 | list_for_each_entry_rcu(tc, &pool->active_thins, list) |
675 | error_thin_bio_list(tc, &tc->retry_on_resume_list, -EIO); | 675 | error_thin_bio_list(tc, &tc->retry_on_resume_list, error); |
676 | rcu_read_unlock(); | 676 | rcu_read_unlock(); |
677 | } | 677 | } |
678 | 678 | ||
679 | static void error_retry_list(struct pool *pool) | ||
680 | { | ||
681 | return error_retry_list_with_code(pool, -EIO); | ||
682 | } | ||
683 | |||
679 | /* | 684 | /* |
680 | * This section of code contains the logic for processing a thin device's IO. | 685 | * This section of code contains the logic for processing a thin device's IO. |
681 | * Much of the code depends on pool object resources (lists, workqueues, etc) | 686 | * Much of the code depends on pool object resources (lists, workqueues, etc) |
@@ -2297,7 +2302,7 @@ static void do_no_space_timeout(struct work_struct *ws) | |||
2297 | if (get_pool_mode(pool) == PM_OUT_OF_DATA_SPACE && !pool->pf.error_if_no_space) { | 2302 | if (get_pool_mode(pool) == PM_OUT_OF_DATA_SPACE && !pool->pf.error_if_no_space) { |
2298 | pool->pf.error_if_no_space = true; | 2303 | pool->pf.error_if_no_space = true; |
2299 | notify_of_pool_mode_change_to_oods(pool); | 2304 | notify_of_pool_mode_change_to_oods(pool); |
2300 | error_retry_list(pool); | 2305 | error_retry_list_with_code(pool, -ENOSPC); |
2301 | } | 2306 | } |
2302 | } | 2307 | } |
2303 | 2308 | ||