Commit a28bd48a authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Add an assertion to check for journal writes to same location

Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent d042b040
......@@ -473,6 +473,7 @@ struct bch_dev {
atomic64_t rebalance_work;
struct journal_device journal;
u64 prev_journal_sector;
struct work_struct io_error_work;
......
......@@ -1286,6 +1286,9 @@ static void do_journal_write(struct closure *cl)
bio->bi_end_io = journal_write_endio;
bio->bi_private = ca;
BUG_ON(bio->bi_iter.bi_sector == ca->prev_journal_sector);
ca->prev_journal_sector = bio->bi_iter.bi_sector;
if (!JSET_NO_FLUSH(w->data))
bio->bi_opf |= REQ_FUA;
if (!JSET_NO_FLUSH(w->data) && !w->separate_flush)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment