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>
This commit is contained in:
Mike Snitzer 2015-07-21 13:20:46 -04:00
Родитель cbfe8fa6cd
Коммит 0a927c2f02
1 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -666,16 +666,21 @@ static void requeue_io(struct thin_c *tc)
requeue_deferred_cells(tc); requeue_deferred_cells(tc);
} }
static void error_retry_list(struct pool *pool) static void error_retry_list_with_code(struct pool *pool, int error)
{ {
struct thin_c *tc; struct thin_c *tc;
rcu_read_lock(); rcu_read_lock();
list_for_each_entry_rcu(tc, &pool->active_thins, list) list_for_each_entry_rcu(tc, &pool->active_thins, list)
error_thin_bio_list(tc, &tc->retry_on_resume_list, -EIO); error_thin_bio_list(tc, &tc->retry_on_resume_list, error);
rcu_read_unlock(); rcu_read_unlock();
} }
static void error_retry_list(struct pool *pool)
{
return error_retry_list_with_code(pool, -EIO);
}
/* /*
* This section of code contains the logic for processing a thin device's IO. * This section of code contains the logic for processing a thin device's IO.
* Much of the code depends on pool object resources (lists, workqueues, etc) * 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)
if (get_pool_mode(pool) == PM_OUT_OF_DATA_SPACE && !pool->pf.error_if_no_space) { if (get_pool_mode(pool) == PM_OUT_OF_DATA_SPACE && !pool->pf.error_if_no_space) {
pool->pf.error_if_no_space = true; pool->pf.error_if_no_space = true;
notify_of_pool_mode_change_to_oods(pool); notify_of_pool_mode_change_to_oods(pool);
error_retry_list(pool); error_retry_list_with_code(pool, -ENOSPC);
} }
} }