From: Linus Torvalds <torvalds@linux-foundation.org>
To: Dmitry Kadashev <dkadashev@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <christian.brauner@ubuntu.com>,
Pavel Begunkov <asml.silence@gmail.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
io-uring <io-uring@vger.kernel.org>
Subject: Re: [PATCH v7 07/10] fs: make do_linkat() take struct filename
Date: Tue, 6 Jul 2021 11:05:18 -0700 [thread overview]
Message-ID: <CAHk-=whdhY-RT=8wky=MgxAo0C9gSODcimLg3brdNy9p6OzhxA@mail.gmail.com> (raw)
In-Reply-To: <20210706124901.1360377-8-dkadashev@gmail.com>
On Tue, Jul 6, 2021 at 5:49 AM Dmitry Kadashev <dkadashev@gmail.com> wrote:
>
> Pass in the struct filename pointers instead of the user string, for
> uniformity with do_renameat2, do_unlinkat, do_mknodat, etc.
This is the only one in the series that I still react fairly negatively at.
I still just don't like how filename_lookup() used to be nice and easy
to understand ("always eat the name"), and while those semantics
remain, the new __filename_lookup() has those odd semantics of only
eating it on failure.
And there is exactly _one_ caller of that new __filename_lookup(), and it does
error = __filename_lookup(olddfd, old, how, &old_path, NULL);
if (error)
goto out_putnew;
and I don't even understand why you'd want to eat it on error, because
if if *didn't* eat it on error, it would just do
error = __filename_lookup(olddfd, old, how, &old_path, NULL);
if (error)
goto out_putnames;
and it would be much easier to understand (and the "out_putnew" label
would go away entirely)
What am I missing? You had some reason for not eating the name
unconditionally, but I look at this patch and I just don't see it.
Linus
next prev parent reply other threads:[~2021-07-06 18:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-06 12:48 [PATCH v7 00/10] io_uring: add mkdir and [sym]linkat support Dmitry Kadashev
2021-07-06 12:48 ` [PATCH v7 01/10] namei: ignore ERR/NULL names in putname() Dmitry Kadashev
2021-07-06 12:48 ` [PATCH v7 02/10] fs: make do_mkdirat() take struct filename Dmitry Kadashev
2021-07-06 12:48 ` [PATCH v7 03/10] io_uring: add support for IORING_OP_MKDIRAT Dmitry Kadashev
2021-07-06 12:48 ` [PATCH v7 04/10] fs: make do_mknodat() take struct filename Dmitry Kadashev
2021-07-06 12:48 ` [PATCH v7 05/10] fs: make do_symlinkat() " Dmitry Kadashev
2021-07-06 12:48 ` [PATCH v7 06/10] namei: add getname_uflags() Dmitry Kadashev
2021-07-06 12:48 ` [PATCH v7 07/10] fs: make do_linkat() take struct filename Dmitry Kadashev
2021-07-06 18:05 ` Linus Torvalds [this message]
2021-07-07 7:27 ` Dmitry Kadashev
2021-07-06 12:48 ` [PATCH v7 08/10] fs: update do_*() helpers to return ints Dmitry Kadashev
2021-07-06 12:49 ` [PATCH v7 09/10] io_uring: add support for IORING_OP_SYMLINKAT Dmitry Kadashev
2021-07-06 12:49 ` [PATCH v7 10/10] io_uring: add support for IORING_OP_LINKAT Dmitry Kadashev
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='CAHk-=whdhY-RT=8wky=MgxAo0C9gSODcimLg3brdNy9p6OzhxA@mail.gmail.com' \
--to=torvalds@linux-foundation.org \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=christian.brauner@ubuntu.com \
--cc=dkadashev@gmail.com \
--cc=io-uring@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).