linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Miklos Szeredi <mszeredi@redhat.com>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	overlayfs <linux-unionfs@vger.kernel.org>
Subject: Re: [PATCH 1/3] vfs: add flags to d_real()
Date: Tue, 5 Sep 2017 11:55:47 +0300	[thread overview]
Message-ID: <CAOQ4uxhv=GSxJjoJbM+qCazCC+VhmuHjDTYNfF0dmjG2tjSHTQ@mail.gmail.com> (raw)
In-Reply-To: <1504597596-17994-2-git-send-email-mszeredi@redhat.com>

On Tue, Sep 5, 2017 at 10:46 AM, Miklos Szeredi <mszeredi@redhat.com> wrote:
> Add a separate flags argument (in addition to the open flags) to control
> the behavior of d_real().
>
> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
> ---
...
> --- a/fs/overlayfs/super.c
> +++ b/fs/overlayfs/super.c
>
>  static struct dentry *ovl_d_real(struct dentry *dentry,
>                                  const struct inode *inode,
> -                                unsigned int open_flags)
> +                                unsigned int open_flags, unsigned int flags)
>  {
>         struct dentry *real;
>         int err;
> @@ -102,7 +102,7 @@ static struct dentry *ovl_d_real(struct dentry *dentry,
>                 goto bug;
>
>         /* Handle recursion */
> -       real = d_real(real, inode, open_flags);
> +       real = d_real(real, inode, open_flags, 0);
>

Shouldn't recursion pass on flags?
The answer is probably per flag.
The 2 currently proposed flags don't end up in recursion anyway,
although it is arguable that D_REAL_ALL should end up in recursion
because according to comment it should behave the same as
d_real for regular files.

For the purpose for which D_REAL_ALL was proposed (atime update)
the recursion case doesn't really matter.

Maybe a flag D_REAL_NORECURSE and then for
update_ovl_inode_times() use D_REAL_ALL|D_REAL_NORECURSE

Alternatively, update_ovl_inode_times() could use D_REAL_UPPER
and then we explicitly say that we don't care about lower mtime/ctime
modifications.

Amir.

  reply	other threads:[~2017-09-05  8:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05  7:46 [PATCH 0/3] overlayfs: vfs fixes Miklos Szeredi
2017-09-05  7:46 ` [PATCH 1/3] vfs: add flags to d_real() Miklos Szeredi
2017-09-05  8:55   ` Amir Goldstein [this message]
2017-09-05  9:02     ` Miklos Szeredi
2017-09-05  7:46 ` [PATCH 2/3] ovl: fix relatime for directories Miklos Szeredi
2017-09-05 12:53   ` Miklos Szeredi
2017-09-05  7:46 ` [PATCH 3/3] ovl: don't allow writing ioctl on lower layer Miklos Szeredi

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='CAOQ4uxhv=GSxJjoJbM+qCazCC+VhmuHjDTYNfF0dmjG2tjSHTQ@mail.gmail.com' \
    --to=amir73il@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --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).