.. | .. |
---|
2217 | 2217 | throttle_work_update(&pool->throttle); |
---|
2218 | 2218 | dm_pool_issue_prefetches(pool->pmd); |
---|
2219 | 2219 | } |
---|
| 2220 | + cond_resched(); |
---|
2220 | 2221 | } |
---|
2221 | 2222 | blk_finish_plug(&plug); |
---|
2222 | 2223 | } |
---|
.. | .. |
---|
2299 | 2300 | else |
---|
2300 | 2301 | pool->process_cell(tc, cell); |
---|
2301 | 2302 | } |
---|
| 2303 | + cond_resched(); |
---|
2302 | 2304 | } while (!list_empty(&cells)); |
---|
2303 | 2305 | } |
---|
2304 | 2306 | |
---|
.. | .. |
---|
2907 | 2909 | dm_bio_prison_destroy(pool->prison); |
---|
2908 | 2910 | dm_kcopyd_client_destroy(pool->copier); |
---|
2909 | 2911 | |
---|
| 2912 | + cancel_delayed_work_sync(&pool->waker); |
---|
| 2913 | + cancel_delayed_work_sync(&pool->no_space_timeout); |
---|
2910 | 2914 | if (pool->wq) |
---|
2911 | 2915 | destroy_workqueue(pool->wq); |
---|
2912 | 2916 | |
---|
.. | .. |
---|
3379 | 3383 | pt->low_water_blocks = low_water_blocks; |
---|
3380 | 3384 | pt->adjusted_pf = pt->requested_pf = pf; |
---|
3381 | 3385 | ti->num_flush_bios = 1; |
---|
| 3386 | + ti->limit_swap_bios = true; |
---|
3382 | 3387 | |
---|
3383 | 3388 | /* |
---|
3384 | 3389 | * Only need to enable discards if the pool should pass |
---|
.. | .. |
---|
3566 | 3571 | */ |
---|
3567 | 3572 | r = bind_control_target(pool, ti); |
---|
3568 | 3573 | if (r) |
---|
3569 | | - return r; |
---|
| 3574 | + goto out; |
---|
3570 | 3575 | |
---|
3571 | 3576 | r = maybe_resize_data_dev(ti, &need_commit1); |
---|
3572 | 3577 | if (r) |
---|
3573 | | - return r; |
---|
| 3578 | + goto out; |
---|
3574 | 3579 | |
---|
3575 | 3580 | r = maybe_resize_metadata_dev(ti, &need_commit2); |
---|
3576 | 3581 | if (r) |
---|
3577 | | - return r; |
---|
| 3582 | + goto out; |
---|
3578 | 3583 | |
---|
3579 | 3584 | if (need_commit1 || need_commit2) |
---|
3580 | 3585 | (void) commit(pool); |
---|
| 3586 | +out: |
---|
| 3587 | + /* |
---|
| 3588 | + * When a thin-pool is PM_FAIL, it cannot be rebuilt if |
---|
| 3589 | + * bio is in deferred list. Therefore need to return 0 |
---|
| 3590 | + * to allow pool_resume() to flush IO. |
---|
| 3591 | + */ |
---|
| 3592 | + if (r && get_pool_mode(pool) == PM_FAIL) |
---|
| 3593 | + r = 0; |
---|
3581 | 3594 | |
---|
3582 | | - return 0; |
---|
| 3595 | + return r; |
---|
3583 | 3596 | } |
---|
3584 | 3597 | |
---|
3585 | 3598 | static void pool_suspend_active_thins(struct pool *pool) |
---|
.. | .. |
---|
4247 | 4260 | goto bad; |
---|
4248 | 4261 | |
---|
4249 | 4262 | ti->num_flush_bios = 1; |
---|
| 4263 | + ti->limit_swap_bios = true; |
---|
4250 | 4264 | ti->flush_supported = true; |
---|
4251 | 4265 | ti->per_io_data_size = sizeof(struct dm_thin_endio_hook); |
---|
4252 | 4266 | |
---|