summaryrefslogtreecommitdiffstats
path: root/drivers/nvme
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2019-11-13 16:03:15 +0800
committerJens Axboe <axboe@kernel.dk>2019-11-13 15:42:49 -0700
commitc0e0954e909c17b43d176ab219fc598964616ae6 (patch)
tree0f16001bfb90ec3539dc6fa0498d2d4a61b1c1d9 /drivers/nvme
parente2a7b9f4a19d3ecb8833ecba9e111e118e17f36c (diff)
bcache: fix fifo index swapping condition in journal_pin_cmp()
Fifo structure journal.pin is implemented by a cycle buffer, if the back index reaches highest location of the cycle buffer, it will be swapped to 0. Once the swapping happens, it means a smaller fifo index might be associated to a newer journal entry. So the btree node with oldest journal entry won't be selected in bch_btree_leaf_dirty() to reference the dirty B+tree leaf node. This problem may cause bcache journal won't protect unflushed oldest B+tree dirty leaf node in power failure, and this B+tree leaf node is possible to beinconsistent after reboot from power failure. This patch fixes the fifo index comparing logic in journal_pin_cmp(), to avoid potential corrupted B+tree leaf node when the back index of journal pin is swapped. Signed-off-by: Coly Li <colyli@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/nvme')
0 files changed, 0 insertions, 0 deletions