if (block_group) {
 #ifdef CONFIG_BTRFS_DEBUG
                        btrfs_err(root->fs_info,
-                                 "failed to write free space cache for block group %llu",
-                                 block_group->start);
+         "failed to write free space cache for block group %llu error %d",
+                                 block_group->start, ret);
 #endif
                }
        }
        if (ret) {
 #ifdef CONFIG_BTRFS_DEBUG
                btrfs_err(fs_info,
-                         "failed to write free space cache for block group %llu",
-                         block_group->start);
+         "failed to write free space cache for block group %llu error %d",
+                         block_group->start, ret);
 #endif
                spin_lock(&block_group->lock);
                block_group->disk_cache_state = BTRFS_DC_ERROR;
                                        inode->i_size, true);
 #ifdef CONFIG_BTRFS_DEBUG
                btrfs_err(fs_info,
-                         "failed to write free ino cache for root %llu",
-                         root->root_key.objectid);
+                         "failed to write free ino cache for root %llu error %d",
+                         root->root_key.objectid, ret);
 #endif
        }