• Kent Overstreet's avatar
    bcachefs: Fix extents iteration + snapshots interaction · fa014953
    Kent Overstreet authored
    peek_upto() checks against the end position and bails out before
    FILTER_SNAPSHOTS checks; this is because if we end up at a different
    inode number than the original search key none of the keys we see might
    be visibile in the current snapshot - we might be looking at inode in a
    completely different subvolume.
    
    But this is broken, because when we're iterating over extents we're
    checking against the extent start position to decide when to bail out,
    and the extent start position isn't monotonically increasing until after
    we've run FILTER_SNAPSHOTS.
    
    Fix this by adding a simple inode number check where the old bailout
    check was, and moving the main check to the correct position.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    Reported-by: default avatar"Carl E. Thompson" <list-bcachefs@carlthompson.net>
    fa014953
btree_iter.c 82.9 KB