]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
bcachefs: Add checks for invalid snapshot IDs
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 22 Mar 2024 20:29:23 +0000 (16:29 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 1 Apr 2024 00:36:11 +0000 (20:36 -0400)
commitec9cc18fc2e65b08c588e01f24aaeb71551a7132
treeaf145579dc99b4b2f90f9ddf72f7f20f6df45106
parent63332394c7e1f4f26e8e5b1387212016aaa7eae2
bcachefs: Add checks for invalid snapshot IDs

Previously, we assumed that keys were consistent with the snapshots
btree - but that's not correct as fsck may not have been run or may not
be complete.

This adds checks and error handling when using the in-memory snapshots
table (that mirrors the snapshots btree).

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