• Coly Li's avatar
    bcache: check CACHE_SET_IO_DISABLE in allocator code · 57cfb755
    Coly Li authored
    [ Upstream commit e775339e ]
    
    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: default avatarColy Li <colyli@suse.de>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    57cfb755
alloc.c 19.1 KB