• Kent Overstreet's avatar
    bcachefs: Fix a write buffer flush deadlock · 01e691e8
    Kent Overstreet authored
    We're not supposed to block if BTREE_INSERT_JOURNAL_RECLAIM && watermark
    != BCH_WATERMARK_reclaim.
    
    This should really be a separate BTREE_INSERT_NONBLOCK flag - add some
    comments to that effect, it's not important for this patch.
    
    btree write buffer flush depends on this behaviour though - the first
    loop tries to flush sequentially, which doesn't free up space in the
    journal optimally. If that can't proceed we bail out and flush in
    journal order - that won't work if we're blocked instead of returning an
    error.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    01e691e8
btree_update_interior.c 66 KB