diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2018-07-10 22:43:57 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-07-10 22:43:57 -0700 |
commit | 4049db73f1a32cd633827f479cb25fdcd231d7f4 (patch) | |
tree | ae3c1d3eb12080b447d732ba37540bb9f87f3a48 /drivers/md/dm-thin.c | |
parent | 62b5f32c45c31528c5228a44c59d150e8a786421 (diff) | |
parent | e1496b74425e222e349b829e84415a380a59f178 (diff) |
Merge "Merge android-4.4.139 (7ba5557) into msm-4.4"
Diffstat (limited to 'drivers/md/dm-thin.c')
-rw-r--r-- | drivers/md/dm-thin.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 5f1a943d9e81..87454a745e13 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -1299,6 +1299,8 @@ static void schedule_external_copy(struct thin_c *tc, dm_block_t virt_block, static void set_pool_mode(struct pool *pool, enum pool_mode new_mode); +static void requeue_bios(struct pool *pool); + static void check_for_space(struct pool *pool) { int r; @@ -1311,8 +1313,10 @@ static void check_for_space(struct pool *pool) if (r) return; - if (nr_free) + if (nr_free) { set_pool_mode(pool, PM_WRITE); + requeue_bios(pool); + } } /* @@ -1389,7 +1393,10 @@ static int alloc_data_block(struct thin_c *tc, dm_block_t *result) r = dm_pool_alloc_data_block(pool->pmd, result); if (r) { - metadata_operation_failed(pool, "dm_pool_alloc_data_block", r); + if (r == -ENOSPC) + set_pool_mode(pool, PM_OUT_OF_DATA_SPACE); + else + metadata_operation_failed(pool, "dm_pool_alloc_data_block", r); return r; } |