btrfs: reduce debug spam from submit_compressed_extents

Move the printk that is supposed to help to debug failures in
submit_one_async_extent into submit_one_async_extent and make it
coniditonal on actually having an error condition instead of spamming
the log unconditionally.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Christoph Hellwig 2023-06-28 17:31:27 +02:00 коммит произвёл David Sterba
Родитель 9783e4deed
Коммит 84f262f009
1 изменённых файлов: 13 добавлений и 20 удалений

Просмотреть файл

@ -1179,11 +1179,11 @@ static int submit_uncompressed_range(struct btrfs_inode *inode,
return ret; return ret;
} }
static int submit_one_async_extent(struct btrfs_inode *inode, static void submit_one_async_extent(struct async_chunk *async_chunk,
struct async_chunk *async_chunk, struct async_extent *async_extent,
struct async_extent *async_extent, u64 *alloc_hint)
u64 *alloc_hint)
{ {
struct btrfs_inode *inode = async_chunk->inode;
struct extent_io_tree *io_tree = &inode->io_tree; struct extent_io_tree *io_tree = &inode->io_tree;
struct btrfs_root *root = inode->root; struct btrfs_root *root = inode->root;
struct btrfs_fs_info *fs_info = root->fs_info; struct btrfs_fs_info *fs_info = root->fs_info;
@ -1276,7 +1276,7 @@ done:
if (async_chunk->blkcg_css) if (async_chunk->blkcg_css)
kthread_associate_blkcg(NULL); kthread_associate_blkcg(NULL);
kfree(async_extent); kfree(async_extent);
return ret; return;
out_free_reserve: out_free_reserve:
btrfs_dec_block_group_reservations(fs_info, ins.objectid); btrfs_dec_block_group_reservations(fs_info, ins.objectid);
@ -1290,7 +1290,13 @@ out_free:
PAGE_UNLOCK | PAGE_START_WRITEBACK | PAGE_UNLOCK | PAGE_START_WRITEBACK |
PAGE_END_WRITEBACK); PAGE_END_WRITEBACK);
free_async_extent_pages(async_extent); free_async_extent_pages(async_extent);
goto done; if (async_chunk->blkcg_css)
kthread_associate_blkcg(NULL);
btrfs_debug(fs_info,
"async extent submission failed root=%lld inode=%llu start=%llu len=%llu ret=%d",
root->root_key.objectid, btrfs_ino(inode), start,
async_extent->ram_size, ret);
kfree(async_extent);
} }
/* /*
@ -1300,28 +1306,15 @@ out_free:
*/ */
static noinline void submit_compressed_extents(struct async_chunk *async_chunk) static noinline void submit_compressed_extents(struct async_chunk *async_chunk)
{ {
struct btrfs_inode *inode = async_chunk->inode;
struct btrfs_fs_info *fs_info = inode->root->fs_info;
struct async_extent *async_extent; struct async_extent *async_extent;
u64 alloc_hint = 0; u64 alloc_hint = 0;
int ret = 0;
while (!list_empty(&async_chunk->extents)) { while (!list_empty(&async_chunk->extents)) {
u64 extent_start;
u64 ram_size;
async_extent = list_entry(async_chunk->extents.next, async_extent = list_entry(async_chunk->extents.next,
struct async_extent, list); struct async_extent, list);
list_del(&async_extent->list); list_del(&async_extent->list);
extent_start = async_extent->start;
ram_size = async_extent->ram_size;
ret = submit_one_async_extent(inode, async_chunk, async_extent, submit_one_async_extent(async_chunk, async_extent, &alloc_hint);
&alloc_hint);
btrfs_debug(fs_info,
"async extent submission failed root=%lld inode=%llu start=%llu len=%llu ret=%d",
inode->root->root_key.objectid,
btrfs_ino(inode), extent_start, ram_size, ret);
} }
} }