From: Al Viro <[email protected]>
To: Stefan Roesch <[email protected]>
Cc: [email protected], [email protected],
[email protected]
Subject: Re: [PATCH v1 1/2] fs: replace const char* parameter in vfs_statx and do_statx with struct filename
Date: Mon, 14 Feb 2022 04:01:43 +0000 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
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.
next prev parent reply other threads:[~2022-02-14 4:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 19:03 [PATCH v1 0/2] io-uring: Make statx api stable Stefan Roesch
2022-02-09 19:03 ` [PATCH v1 1/2] fs: replace const char* parameter in vfs_statx and do_statx with struct filename Stefan Roesch
2022-02-14 4:01 ` Al Viro [this message]
2022-02-09 19:03 ` [PATCH v1 2/2] io-uring: Copy path name during prepare stage for statx Stefan Roesch
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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