From: Filipe Manana Date: Wed, 16 Jul 2025 16:36:13 +0000 (+0100) Subject: btrfs: return real error from read_alloc_one_name() in drop_one_dir_item() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=874576d2a79a2e94cffc89b3bd0c285141b99208;p=users%2Fhch%2Fmisc.git btrfs: return real error from read_alloc_one_name() in drop_one_dir_item() If read_alloc_one_name() we explicitly return -ENOMEM and currently that is fine since it's the only error read_alloc_one_name() can return for now. However this is fragile and not future proof, so return instead what read_alloc_one_name() returned. Reviewed-by: Boris Burkov Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index bb8d4d1a30ef..a4068be25996 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -943,7 +943,7 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans, btrfs_dir_item_key_to_cpu(leaf, di, &location); ret = read_alloc_one_name(leaf, di + 1, btrfs_dir_name_len(leaf, di), &name); if (ret) - return -ENOMEM; + return ret; btrfs_release_path(path);