linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Christian Brauner <brauner@kernel.org>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	Al Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	Paul Moore <paul@paul-moore.com>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org
Subject: Re: [PATCH 3/3] fs: store fake path in file_fake along with real path
Date: Fri, 9 Jun 2023 14:30:44 +0300	[thread overview]
Message-ID: <CAOQ4uxjC_VpdKFmWKghLGv-CczfeZRbZAXrdztSctZPnx+2rTA@mail.gmail.com> (raw)
In-Reply-To: <20230609-bannmeile-speziell-54dc72b5008c@brauner>

On Fri, Jun 9, 2023 at 2:12 PM Christian Brauner <brauner@kernel.org> wrote:
>
> On Fri, Jun 09, 2023 at 10:32:39AM +0300, Amir Goldstein wrote:
> > Instead of storing only the fake path in f_path, store the real path
> > in f_path and the fake path in file_fake container.
> >
> > Call sites that use the macro file_fake_path() continue to get the fake
> > path from its new location.
> >
> > Call sites that access f_path directly will now see the overlayfs real
> > path instead of the fake overlayfs path, which is the desired bahvior
> > for most users, because it makes f_path consistent with f_inode.
> >
> > Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> > ---
>
> If you resend, can you take the chance and refactor this into a slightly more
> readable pattern, please? So something like
>

Sure!
I like this better myself.

Thanks,
Amir.

> struct file *open_with_fake_path(const struct path *fake_path, int flags,
>                                  const struct path *path,
>                                  const struct cred *cred)
> {
>         int error;
>         struct file *f;
>
>         f = alloc_empty_file_fake(fake_path, flags, cred);
>         if (IS_ERR(f))
>                 return f;
>
>         f->f_path = *path;
>         error = do_dentry_open(f, d_inode(path->dentry), NULL);
>         if (error) {
>                 fput(f);
>                 return ERR_PTR(error);
>         }
>
>         return f;
> }

  reply	other threads:[~2023-06-09 11:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09  7:32 [PATCH 0/3] Reduce impact of overlayfs fake path files Amir Goldstein
2023-06-09  7:32 ` [PATCH 1/3] fs: use fake_file container for internal files with fake f_path Amir Goldstein
2023-06-09 11:32   ` Christian Brauner
2023-06-09 11:57     ` Amir Goldstein
2023-06-09 12:12       ` Christian Brauner
2023-06-09 12:20         ` Amir Goldstein
2023-06-09 12:54           ` Christian Brauner
2023-06-09 13:00             ` Christian Brauner
2023-06-09 13:09               ` Amir Goldstein
2023-06-11 19:11         ` Amir Goldstein
2023-06-12  7:55           ` Christian Brauner
2023-06-09  7:32 ` [PATCH 2/3] fs: use file_fake_path() to get path of mapped files for display Amir Goldstein
2023-06-09  8:19   ` Miklos Szeredi
2023-06-09  7:32 ` [PATCH 3/3] fs: store fake path in file_fake along with real path Amir Goldstein
2023-06-09 11:12   ` Christian Brauner
2023-06-09 11:30     ` Amir Goldstein [this message]
2023-06-09 13:15 ` [PATCH 0/3] Reduce impact of overlayfs fake path files Miklos Szeredi
2023-06-09 14:28   ` Amir Goldstein
2023-06-09 14:42     ` Amir Goldstein
2023-06-09 15:00       ` Miklos Szeredi
2023-06-09 19:17         ` Amir Goldstein
2023-06-12  7:57         ` Christian Brauner
2023-10-02 15:32         ` Amir Goldstein
2023-10-04 15:29           ` Amir Goldstein
2023-06-09 15:27     ` Mimi Zohar
2023-06-09 13:15 ` Tetsuo Handa
2023-06-09 13:54   ` Amir Goldstein

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=CAOQ4uxjC_VpdKFmWKghLGv-CczfeZRbZAXrdztSctZPnx+2rTA@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=paul@paul-moore.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --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).