bcachefs: use reservation for log messages during recovery
authorBrian Foster <bfoster@redhat.com>
Wed, 22 Mar 2023 12:27:58 +0000 (08:27 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:59 +0000 (17:09 -0400)
commit349b1d832ba534b802a28f316e40128c54643c32
treee8c727266703c98c8e36b2cce946110f1e55c640
parent3d86f13df67b554a7b27e28a4b144425710409bf
bcachefs: use reservation for log messages during recovery

If we block on journal reservation attempting to log journal
messages during recovery, particularly for the first message(s)
before we start doing actual work, chances are the filesystem ends
up deadlocked.

Allow logged messages to use reserved journal space to mitigate this
problem. In the worst case where no space is available whatsoever,
this at least allows the fs to recognize that the journal is stuck
and fail the mount gracefully.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_update.h
fs/bcachefs/btree_update_leaf.c
fs/bcachefs/recovery.c