btrfs: remove out label in finish_verity()
authorFilipe Manana <fdmanana@suse.com>
Tue, 20 Jan 2026 20:05:43 +0000 (20:05 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 3 Feb 2026 06:56:22 +0000 (07:56 +0100)
There is no point in having the label since all it does is return the
value in the 'ret' variable. Instead make every goto return directly
and remove the label.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.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 a2ac3fb..06cbd6f 100644 (file)
@@ -525,23 +525,21 @@ static int finish_verity(struct btrfs_inode *inode, const void *desc,
        ret = write_key_bytes(inode, BTRFS_VERITY_DESC_ITEM_KEY, 0,
                              (const char *)&item, sizeof(item));
        if (ret)
-               goto out;
+               return ret;
 
        /* Write out the descriptor itself */
        ret = write_key_bytes(inode, BTRFS_VERITY_DESC_ITEM_KEY, 1,
                              desc, desc_size);
        if (ret)
-               goto out;
+               return ret;
 
        /*
         * 1 for updating the inode flag
         * 1 for deleting the orphan
         */
        trans = btrfs_start_transaction(root, 2);
-       if (IS_ERR(trans)) {
-               ret = PTR_ERR(trans);
-               goto out;
-       }
+       if (IS_ERR(trans))
+               return PTR_ERR(trans);
        inode->ro_flags |= BTRFS_INODE_RO_VERITY;
        btrfs_sync_inode_flags_to_i_flags(inode);
        ret = btrfs_update_inode(trans, inode);
@@ -554,8 +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);
-out:
-       return ret;
+       return 0;
 
 }