• Kent Overstreet's avatar
    bcachefs: Fix usage of six lock's percpu mode · 30985537
    Kent Overstreet authored
    Six locks have a percpu mode, which we use for interior btree nodes, as
    well as btree key cache keys for the subvolumes btree. We've been
    switching locks back and forth between percpu and non percpu mode as
    needed, but it turns out this is racy - when we're reusing an existing
    node, other threads could be attempting to lock it while we're switching
    it between modes.
    
    This patch fixes this by never switching 'struct btree' between the two
    modes, and instead segragating them between two different freed lists.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    30985537
btree_cache.h 3.16 KB