Linux XFS filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-xfs@vger.kernel.org, Dave Chinner <dchinner@redhat.com>
Subject: Re: [PATCH 32/32] xfs: switch xfs_attrmulti_attr_get to lazy attr buffer allocation
Date: Wed, 26 Feb 2020 12:33:35 -0800	[thread overview]
Message-ID: <20200226203335.GJ8045@magnolia> (raw)
In-Reply-To: <20200226202306.871241-33-hch@lst.de>

On Wed, Feb 26, 2020 at 12:23:06PM -0800, Christoph Hellwig wrote:
> Let the low-level attr code only allocate the needed buffer size
> for xfs_attrmulti_attr_get instead of allocating the upper bound
> at the top of the call chain.
> 
> Suggested-by: Dave Chinner <dchinner@redhat.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/xfs/xfs_ioctl.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index c805fdf4ea39..47a92400929b 100644
> --- a/fs/xfs/xfs_ioctl.c
> +++ b/fs/xfs/xfs_ioctl.c
> @@ -481,10 +481,6 @@ xfs_attrmulti_attr_get(
>  	if (*len > XFS_XATTR_SIZE_MAX)
>  		return -EINVAL;
>  
> -	args.value = kmem_zalloc_large(*len, 0);
> -	if (!args.value)
> -		return -ENOMEM;
> -
>  	error = xfs_attr_get(&args);
>  	if (error)
>  		goto out_kfree;
> -- 
> 2.24.1
> 

  reply	other threads:[~2020-02-26 20:33 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 20:22 clean up the attr interface v7 Christoph Hellwig
2020-02-26 20:22 ` [PATCH 01/32] xfs: reject invalid flags combinations in XFS_IOC_ATTRLIST_BY_HANDLE Christoph Hellwig
2020-02-26 20:22 ` [PATCH 02/32] xfs: remove the ATTR_INCOMPLETE flag Christoph Hellwig
2020-02-26 20:22 ` [PATCH 03/32] xfs: merge xfs_attr_remove into xfs_attr_set Christoph Hellwig
2020-02-26 20:22 ` [PATCH 04/32] xfs: merge xfs_attrmulti_attr_remove into xfs_attrmulti_attr_set Christoph Hellwig
2020-02-26 20:22 ` [PATCH 05/32] xfs: use strndup_user in XFS_IOC_ATTRMULTI_BY_HANDLE Christoph Hellwig
2020-02-26 20:22 ` [PATCH 06/32] xfs: factor out a helper for a single XFS_IOC_ATTRMULTI_BY_HANDLE op Christoph Hellwig
2020-02-26 20:22 ` [PATCH 07/32] xfs: remove the name == NULL check from xfs_attr_args_init Christoph Hellwig
2020-02-26 20:22 ` [PATCH 08/32] xfs: remove the MAXNAMELEN " Christoph Hellwig
2020-02-26 20:22 ` [PATCH 09/32] xfs: turn xfs_da_args.value into a void pointer Christoph Hellwig
2020-02-26 20:22 ` [PATCH 10/32] xfs: pass an initialized xfs_da_args structure to xfs_attr_set Christoph Hellwig
2020-02-26 20:22 ` [PATCH 11/32] xfs: pass an initialized xfs_da_args to xfs_attr_get Christoph Hellwig
2020-02-26 20:22 ` [PATCH 12/32] xfs: remove the xfs_inode argument to xfs_attr_get_ilocked Christoph Hellwig
2020-02-26 20:22 ` [PATCH 13/32] xfs: remove ATTR_KERNOVAL Christoph Hellwig
2020-02-26 20:22 ` [PATCH 14/32] xfs: remove ATTR_ALLOC and XFS_DA_OP_ALLOCVAL Christoph Hellwig
2020-02-26 20:22 ` [PATCH 15/32] xfs: replace ATTR_KERNOTIME with XFS_DA_OP_NOTIME Christoph Hellwig
2020-02-26 20:22 ` [PATCH 16/32] xfs: factor out a xfs_attr_match helper Christoph Hellwig
2020-02-26 20:22 ` [PATCH 17/32] xfs: cleanup struct xfs_attr_list_context Christoph Hellwig
2020-02-26 20:22 ` [PATCH 18/32] xfs: remove the unused ATTR_ENTRY macro Christoph Hellwig
2020-02-26 20:22 ` [PATCH 19/32] xfs: open code ATTR_ENTSIZE Christoph Hellwig
2020-02-26 20:22 ` [PATCH 20/32] xfs: move the legacy xfs_attr_list to xfs_ioctl.c Christoph Hellwig
2020-02-26 20:22 ` [PATCH 21/32] xfs: rename xfs_attr_list_int to xfs_attr_list Christoph Hellwig
2020-02-26 20:22 ` [PATCH 22/32] xfs: lift common checks into xfs_ioc_attr_list Christoph Hellwig
2020-02-26 20:22 ` [PATCH 23/32] xfs: lift buffer allocation " Christoph Hellwig
2020-02-26 20:22 ` [PATCH 24/32] xfs: lift cursor copy in/out " Christoph Hellwig
2020-02-26 20:22 ` [PATCH 25/32] xfs: improve xfs_forget_acl Christoph Hellwig
2020-02-26 20:23 ` [PATCH 26/32] xfs: clean up the ATTR_REPLACE checks Christoph Hellwig
2020-02-26 20:23 ` [PATCH 27/32] xfs: clean up the attr flag confusion Christoph Hellwig
2020-02-26 20:23 ` [PATCH 28/32] xfs: remove XFS_DA_OP_INCOMPLETE Christoph Hellwig
2020-02-26 20:23 ` [PATCH 29/32] xfs: embedded the attrlist cursor into struct xfs_attr_list_context Christoph Hellwig
2020-02-26 20:23 ` [PATCH 30/32] xfs: clean up bufsize alignment in xfs_ioc_attr_list Christoph Hellwig
2020-02-26 20:23 ` [PATCH 31/32] xfs: only allocate the buffer size actually needed in __xfs_set_acl Christoph Hellwig
2020-02-26 20:37   ` Darrick J. Wong
2020-02-26 21:35   ` Dave Chinner
2020-02-26 20:23 ` [PATCH 32/32] xfs: switch xfs_attrmulti_attr_get to lazy attr buffer allocation Christoph Hellwig
2020-02-26 20:33   ` Darrick J. Wong [this message]
2020-02-26 21:40   ` Dave Chinner

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=20200226203335.GJ8045@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=dchinner@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    /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