bcachefs: Fix missing transaction commit
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 12 Nov 2023 20:47:02 +0000 (15:47 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Wed, 15 Nov 2023 04:44:43 +0000 (23:44 -0500)
commitf42fa17883e73d8509fff5925781d4157db82f00
tree02602d511f63ebf20b3b9bc1bb239263fe79e768
parent178c4873fd06c0361d260547ce70fcdc29b74809
bcachefs: Fix missing transaction commit

In may_delete_deleted_inode(), there's a corner case when a snapshot was
taken while we had an unlinked inode: we don't want to delete the inode
in the internal (shared) snapshot node, since it might have been
reattached in a descendent snapshot.

Instead we propagate the key to any snapshot leaves it doesn't exist in,
so that it can be deleted there if necessary, and then clear the
unlinked flag in the internal node.

But we forgot to commit after clearing the unlinked flag, causing us to
go into an infinite loop.

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