Re: [PATCH 06/29] xfs: remove the name == NULL check from xfs_attr_args_init

Darrick J. Wong
2020-01-21T17:57:59Z

On Tue, Jan 14, 2020 at 09:10:28AM +0100, Christoph Hellwig wrote:
> All callers provide a valid name pointer, remove the redundant check.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Hm. I wondered if this should become at least an ASSERT(name != NULL)
to catch future users screwing that up, but I think the answer is that
we'll crash soon enough in xfs_da_hashname?

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

--D

> ---
> fs/xfs/libxfs/xfs_attr.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
> index 04431ab9f5f5..d5064213577c 100644
> --- a/fs/xfs/libxfs/xfs_attr.c
> +++ b/fs/xfs/libxfs/xfs_attr.c
> @@ -65,10 +65,6 @@ xfs_attr_args_init(
> size_t namelen,
> int flags)
> {
> -
> - if (!name)
> - return -EINVAL;
> -
> memset(args, 0, sizeof(*args));
> args->geo = dp->i_mount->m_attr_geo;
> args->whichfork = XFS_ATTR_FORK;
> --
> 2.24.1
>