Linux EXT4 FS development
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Ye Bin <yebin@huaweicloud.com>
Cc: tytso@mit.edu, adilger.kernel@dilger.ca,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	jack@suse.cz, Ye Bin <yebin10@huawei.com>
Subject: Re: [PATCH v2 4/6] ext4: allocate extended attribute value in vmalloc area
Date: Wed, 7 Dec 2022 11:58:19 +0100	[thread overview]
Message-ID: <20221207105819.jmirjhh6ygknsbcm@quack3> (raw)
In-Reply-To: <20221207074043.1286731-5-yebin@huaweicloud.com>

On Wed 07-12-22 15:40:41, Ye Bin wrote:
> From: Ye Bin <yebin10@huawei.com>
> 
> Now, extended attribute value maxium length is 64K. The memory requested here
> does not need continuous physical addresses, so it is appropriate to use
> kvmalloc to request memory. At the same time, it can also cope with the
> situation that the extended attribute will become longer in the future.
> 
> Signed-off-by: Ye Bin <yebin10@huawei.com>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

Thanks!

								Honza

> ---
>  fs/ext4/xattr.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
> index 75287422c36c..efa623658c12 100644
> --- a/fs/ext4/xattr.c
> +++ b/fs/ext4/xattr.c
> @@ -2579,7 +2579,7 @@ static int ext4_xattr_move_to_block(handle_t *handle, struct inode *inode,
>  
>  	is = kzalloc(sizeof(struct ext4_xattr_ibody_find), GFP_NOFS);
>  	bs = kzalloc(sizeof(struct ext4_xattr_block_find), GFP_NOFS);
> -	buffer = kmalloc(value_size, GFP_NOFS);
> +	buffer = kvmalloc(value_size, GFP_NOFS);
>  	b_entry_name = kmalloc(entry->e_name_len + 1, GFP_NOFS);
>  	if (!is || !bs || !buffer || !b_entry_name) {
>  		error = -ENOMEM;
> @@ -2631,7 +2631,7 @@ static int ext4_xattr_move_to_block(handle_t *handle, struct inode *inode,
>  	error = 0;
>  out:
>  	kfree(b_entry_name);
> -	kfree(buffer);
> +	kvfree(buffer);
>  	if (is)
>  		brelse(is->iloc.bh);
>  	if (bs)
> -- 
> 2.31.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2022-12-07 10:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07  7:40 [PATCH v2 0/6] Fix two issue about ext4 extended attribute Ye Bin
2022-12-07  7:40 ` [PATCH v2 1/6] ext4: fix WARNING in ext4_expand_extra_isize_ea Ye Bin
2022-12-07  7:51   ` Bagas Sanjaya
2022-12-07  7:40 ` [PATCH v2 2/6] ext4: add primary check extended attribute inode in ext4_xattr_check_entries() Ye Bin
2022-12-07  7:37   ` Bagas Sanjaya
2022-12-07 11:14   ` Jan Kara
2022-12-07 11:39     ` yebin (H)
2022-12-07 12:03       ` Jan Kara
2022-12-07  7:40 ` [PATCH v2 3/6] ext4: remove unnessary size check in ext4_xattr_inode_get() Ye Bin
2022-12-07  7:40 ` [PATCH v2 4/6] ext4: allocate extended attribute value in vmalloc area Ye Bin
2022-12-07 10:58   ` Jan Kara [this message]
2022-12-07  7:40 ` [PATCH v2 5/6] ext4: rename xattr_find_entry() and __xattr_check_inode() Ye Bin
2022-12-07  7:35   ` Bagas Sanjaya
2022-12-07  7:41     ` Bagas Sanjaya
2022-12-07 10:58   ` Jan Kara
2022-12-07  7:40 ` [PATCH v2 6/6] ext4: fix inode leak in 'ext4_xattr_inode_create()' Ye Bin
2022-12-07  7:44   ` Bagas Sanjaya
2022-12-07 11:00   ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221207105819.jmirjhh6ygknsbcm@quack3 \
    --to=jack@suse.cz \
    --cc=adilger.kernel@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=yebin10@huawei.com \
    --cc=yebin@huaweicloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox