Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1726577

Re: [PATCH 1/3] vfs: add flags to d_real()

From Miklos Szeredi <mszeredi@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] vfs: add flags to d_real()
Date 2017-09-05 11:10 +0200
Message-ID <umi1P-Ly-17@gated-at.bofh.it> (permalink)
References <umgMq-8hx-3@gated-at.bofh.it> <umgMq-8hx-11@gated-at.bofh.it> <umhSb-t5-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Sep 5, 2017 at 10:55 AM, Amir Goldstein <amir73il@gmail.com> wrote:
> 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.

Well, D_REAL_ALL imples nonrecurse.  Maybe that needs better
documentation (comment above in ovl_d_real()) but I don't otherwise
see a problem with the current state of affairs.

Thanks,
Miklos

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] overlayfs: vfs fixes Miklos Szeredi <mszeredi@redhat.com> - 2017-09-05 09:50 +0200
  [PATCH 3/3] ovl: don't allow writing ioctl on lower layer Miklos Szeredi <mszeredi@redhat.com> - 2017-09-05 09:50 +0200
  [PATCH 1/3] vfs: add flags to d_real() Miklos Szeredi <mszeredi@redhat.com> - 2017-09-05 09:50 +0200
    Re: [PATCH 1/3] vfs: add flags to d_real() Amir Goldstein <amir73il@gmail.com> - 2017-09-05 11:00 +0200
      Re: [PATCH 1/3] vfs: add flags to d_real() Miklos Szeredi <mszeredi@redhat.com> - 2017-09-05 11:10 +0200
  [PATCH 2/3] ovl: fix relatime for directories Miklos Szeredi <mszeredi@redhat.com> - 2017-09-05 09:50 +0200
    Re: [PATCH 2/3] ovl: fix relatime for directories Miklos Szeredi <miklos@szeredi.hu> - 2017-09-05 15:00 +0200

csiph-web