record_root_in_trans can fail currently, so handle this failure
properly.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
         * recorded root will never be updated again, causing an outdated root
         * item.
         */
-       record_root_in_trans(trans, src, 1);
+       ret = record_root_in_trans(trans, src, 1);
+       if (ret)
+               return ret;
 
        /*
         * btrfs_qgroup_inherit relies on a consistent view of the usage for the
         * insert_dir_item()
         */
        if (!ret)
-               record_root_in_trans(trans, parent, 1);
+               ret = record_root_in_trans(trans, parent, 1);
        return ret;
 }