public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Dmitry Kadashev <[email protected]>
Cc: Jens Axboe <[email protected]>, [email protected]
Subject: Re: Use of disowned struct filename after 3c5499fa56f5?
Date: Fri, 6 Nov 2020 12:49:05 +0000	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 06/11/2020 10:08, Dmitry Kadashev wrote:
> On Thu, Nov 05, 2020 at 08:57:43PM +0000, Pavel Begunkov wrote:
> That's pretty much what do_unlinkat() does btw. Thanks Pavel for looking
> into this!
> 
> Can I pick your brain some more? do_mkdirat() case is slightly
> different:
> 
> static long do_mkdirat(int dfd, const char __user *pathname, umode_t mode)
> {
> 	struct dentry *dentry;
> 	struct path path;
> 	int error;
> 	unsigned int lookup_flags = LOOKUP_DIRECTORY;
> 
> retry:
> 	dentry = user_path_create(dfd, pathname, &path, lookup_flags);
> 
> If we just change @pathname to struct filename, then user_path_create
> can be swapped for filename_create(). But the same problem on retry
> arises. Is there some more or less "idiomatic" way to solve this?

I don't think there is, fs guys may have a different opinion but
sometimes it's hard to get through them.

I'd take a filename reference before "retry:" and putname(filename) on
exit. Skimmed quickly and looks like nobody changes it anywhere in
user_path_create(). Since you're doing it for io_uring and so going to
push it through Jens's tree it's better to keep it small and localised
in do_mkdirat() to not cause merging troubles.

-- 
Pavel Begunkov

  reply	other threads:[~2020-11-06 12:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 12:36 Use of disowned struct filename after 3c5499fa56f5? Dmitry Kadashev
2020-11-05 14:22 ` Pavel Begunkov
2020-11-05 14:26   ` Pavel Begunkov
2020-11-05 14:55   ` Pavel Begunkov
2020-11-05 19:37     ` Jens Axboe
2020-11-05 20:04       ` Pavel Begunkov
2020-11-05 20:18         ` Pavel Begunkov
2020-11-05 20:26         ` Jens Axboe
2020-11-05 20:35           ` Pavel Begunkov
2020-11-05 20:49             ` Jens Axboe
2020-11-05 20:57               ` Pavel Begunkov
2020-11-05 21:12                 ` Jens Axboe
2020-11-06 10:08                 ` Dmitry Kadashev
2020-11-06 12:49                   ` Pavel Begunkov [this message]
2020-11-06 13:15                     ` Dmitry Kadashev
2020-11-06 13:27                       ` Pavel Begunkov
2020-11-06 13:35                         ` 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 \
    [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