From: Filipe Manana Date: Wed, 3 Sep 2025 16:43:04 +0000 (+0100) Subject: btrfs: abort transaction if we fail to update inode in log replay dir fixup X-Git-Tag: v6.12.57~23 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=32054a9216bebde6cc0a9cbfa22f3f2a8f4f9a53;p=thirdparty%2Fkernel%2Fstable.git btrfs: abort transaction if we fail to update inode in log replay dir fixup [ Upstream commit 5a0565cad3ef7cbf4cf43d1dd1e849b156205292 ] If we fail to update the inode at link_to_fixup_dir(), we don't abort the transaction and propagate the error up the call chain, which makes it hard to pinpoint the error to the inode update. So abort the transaction if the inode update call fails, so that if it happens we known immediately. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index b43a7c0c7cb7..173e13e1d5b8 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -1778,6 +1778,8 @@ static noinline int link_to_fixup_dir(struct btrfs_trans_handle *trans, else inc_nlink(vfs_inode); ret = btrfs_update_inode(trans, inode); + if (ret) + btrfs_abort_transaction(trans, ret); } else if (ret == -EEXIST) { ret = 0; }