Re: [PATCH v1 1/2] fs: replace const char* parameter in vfs_statx and do_statx with struct filename

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 09, 2022 at 11:03:44AM -0800, Stefan Roesch wrote:
> +	int ret;
> +	int statx_flags = flags | AT_NO_AUTOMOUNT;
> +	struct filename *name;
> +
> +	name = getname_flags(filename, getname_statx_lookup_flags(statx_flags), NULL);
> +	ret = vfs_statx(dfd, name, statx_flags, stat, STATX_BASIC_STATS);
> +	if (name)
> +		putname(name);

1) getname and friends return an error as ERR_PTR(-E...), not NULL
2) filename_lookup() et.al. treat ERR_PTR(-E...) as "fail with -E..."
3) putname(ERR_PTR(-E...)) is a no-op.

IOW, that if (name) putname(name); is unidiomatic and misleading.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux