bcachefs: Correctly order flushes and journal writes on multi device filesystems
authorKent Overstreet <kent.overstreet@gmail.com>
Sat, 16 Jan 2021 20:40:33 +0000 (15:40 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:51 +0000 (17:08 -0400)
commit280249b9d9b9a62562ddeb5429a7d29d2f03ba1c
tree3f67835c9f401afb6062d819a4ace409ae7d7144
parented9d58a2b1ddbc38816571638ee114b7efb9f279
bcachefs: Correctly order flushes and journal writes on multi device filesystems

All writes prior to a journal write need to be flushed before the
journal write itself happens. On single device filesystems, it suffices
to mark the write with REQ_PREFLUSH|REQ_FUA, but on multi device
filesystems we need to issue flushes to every device - and wait for them
to complete - before issuing the journal writes. Previously, we were
issuing flushes to every device, but we weren't waiting for them to
complete before issuing the journal writes.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/io.c
fs/bcachefs/journal.c
fs/bcachefs/journal.h
fs/bcachefs/journal_io.c
fs/bcachefs/journal_types.h