]> git.baikalelectronics.ru Git - kernel.git/commit
bcache: check CACHE_SET_IO_DISABLE in allocator code
authorColy Li <colyli@suse.de>
Fri, 28 Jun 2019 11:59:35 +0000 (19:59 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 28 Jun 2019 13:39:15 +0000 (07:39 -0600)
commitb17a9eb5f04e037c4cf1067b564fe2dff1490de3
tree8b898a7b1ab8eeef2b131e8d86bde507eeea0462
parent1038a5d18df036fad69e7a3a0d55783133dda68d
bcache: check CACHE_SET_IO_DISABLE in allocator code

If CACHE_SET_IO_DISABLE of a cache set flag is set by too many I/O
errors, currently allocator routines can still continue allocate
space which may introduce inconsistent metadata state.

This patch checkes CACHE_SET_IO_DISABLE bit in following allocator
routines,
- bch_bucket_alloc()
- __bch_bucket_alloc_set()
Once CACHE_SET_IO_DISABLE is set on cache set, the allocator routines
may reject allocation request earlier to avoid potential inconsistent
metadata.

Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/alloc.c