• Kent Overstreet's avatar
    bcachefs: Fix for long running btree transactions & key cache · e242b92a
    Kent Overstreet authored
    While a btree transaction is running, we hold a SRCU read lock on the
    btree key cache that prevents btree key cache keys from being freed -
    this is so that relock() operations won't access freed memory.
    
    The downside of this is that long running btree transactions prevent
    memory from being freed from the key cache. This adds a check in
    bch2_trans_begin() - if the transaction has been running longer than 1
    second, drop and retake the SRCU read lock and zero out pointers to
    unlock key cache paths.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    e242b92a
errcode.h 5.82 KB