]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: fix lost return value on error in finish_verity()
authorFilipe Manana <fdmanana@suse.com>
Sun, 8 Feb 2026 18:30:08 +0000 (18:30 +0000)
committerDavid Sterba <dsterba@suse.com>
Wed, 18 Feb 2026 14:25:54 +0000 (15:25 +0100)
If btrfs_update_inode() or del_orphan() fail, we jump to the 'end_trans'
label and then return 0 instead of the error returned by one of those
calls. Fix this and return the error.

Fixes: 61fb7f04ee06 ("btrfs: remove out label in finish_verity()")
Reported-by: Chris Mason <clm@meta.com>
Link: https://lore.kernel.org/linux-btrfs/20260208161129.3888234-1-clm@meta.com/
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/verity.c

index 06cbd6f00a78cb5fae48ccdb2c94a70c10f77e61..95ea794f20d37a764f8555fe6c28ed0b1675fec0 100644 (file)
@@ -552,7 +552,7 @@ static int finish_verity(struct btrfs_inode *inode, const void *desc,
        btrfs_set_fs_compat_ro(root->fs_info, VERITY);
 end_trans:
        btrfs_end_transaction(trans);
-       return 0;
+       return ret;
 
 }