• Coly Li's avatar
    bcache: check CACHE_SET_IO_DISABLE bit in bch_journal() · d81080a0
    Coly Li authored
    [ Upstream commit 383ff218 ]
    
    When too many I/O errors happen on cache set and CACHE_SET_IO_DISABLE
    bit is set, bch_journal() may continue to work because the journaling
    bkey might be still in write set yet. The caller of bch_journal() may
    believe the journal still work but the truth is in-memory journal write
    set won't be written into cache device any more. This behavior may
    introduce potential inconsistent metadata status.
    
    This patch checks CACHE_SET_IO_DISABLE bit at the head of bch_journal(),
    if the bit is set, bch_journal() returns NULL immediately to notice
    caller to know journal does not work.
    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>
    d81080a0
journal.c 20.2 KB