Re: [PATCH v4 15/46] btrfs: handle nokey names.

Eric Biggers
2023-12-05T05:29:16Z

On Fri, Dec 01, 2023 at 05:11:12PM -0500, Josef Bacik wrote:
> +/*
> + * From a given location in a leaf, read a name into a qstr (usually a
> + * fscrypt_name's disk_name), allocating the required buffer. Used for
> + * nokey names.
> + */
> +int btrfs_fscrypt_get_disk_name(struct extent_buffer *leaf,
> + struct btrfs_dir_item *dir_item,
> + struct fscrypt_str *name)
> +{
> + unsigned long de_name_len = btrfs_dir_name_len(leaf, dir_item);
> + unsigned long de_name = (unsigned long)(dir_item + 1);
> + /*
> + * For no-key names, we use this opportunity to find the disk
> + * name, so future searches don't need to deal with nokey names
> + * and we know what the encrypted size is.
> + */
> + name->name = kmalloc(de_name_len, GFP_NOFS);
> +
> + if (!name->name)
> + return -ENOMEM;

Where is the kfree() that matches the above kmalloc()?

- Eric