Re: [PATCH v15 10/30] ovl: Modify ovl_lookup() and friends to lookup metacopy dentry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 11, 2018 at 06:05:11PM +0300, Amir Goldstein wrote:

[..]
> > +                *
> > +                * For non-dir dentry, if index=on, then ensure origin
> > +                * matches the dentry found using path based lookup,
> > +                * otherwise error out. If index=off, then do not error
> > +                * out if origin does not match.
> >                  */
> > -               if (upperdentry && !ctr && ovl_verify_lower(dentry->d_sb)) {
> > +               if (upperdentry && !ctr &&
> > +                   ((d.is_dir && ovl_verify_lower(dentry->d_sb)) ||
> > +                    (!d.is_dir && origin_path))) {
> >                         err = ovl_verify_origin(upperdentry, this, false);
> >                         if (err) {
> > -                               dput(this);
> > -                               break;
> > +                               if (d.is_dir) {
> > +                                       dput(this);
> > +                                       break;
> > +                               } else if (ofs->config.index) {
> > +                                       dput(this);
> > +                                       goto out_put;
> > +                               }
> > +                       } else {
> > +                               /* Bless lower as verified origin */
> > +                               origin = this;
> >                         }
> > +               }
> >
> 
> Logically, this looks correct, but if we don't need the blessing for index=off
> and we won't fail lookup, then there is no need to ovl_verify_origin() at
> all if index=off, so this shrinks a few lines of code and saves the extra
> check.

Makes sense. Will change. Call ovl_verify_origin() only if index is
on for non-dir files.

Vivek
> 
> Thanks,
> Amir.
--
To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux