bcachefs: Fix check_snapshot() memcpy
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 24 Feb 2024 06:18:45 +0000 (01:18 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 25 Feb 2024 01:47:47 +0000 (20:47 -0500)
commitc4333eb541b92d91be57f757dccf6d4368516746
treed18a2d02477c15b7ab2b036782e8233b29226cbf
parent097471f9e458dbbe41e25394c1fb1ccd751f0bee
bcachefs: Fix check_snapshot() memcpy

check_snapshot() copies the bch_snapshot to a temporary to easily handle
older versions that don't have all the fields of the current version,
but it lacked a min() to correctly handle keys newer and larger than the
current version.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/snapshot.c