Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1509100
| From | Miklos Szeredi <miklos@szeredi.hu> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 3/3] ovl: redirect on rename-dir |
| Date | 2016-10-26 13:30 +0200 |
| Message-ID | <swuz7-2VL-19@gated-at.bofh.it> (permalink) |
| References | <sw4uZ-2vP-5@gated-at.bofh.it> <sw4uZ-2vP-27@gated-at.bofh.it> <sw9uG-5Lw-31@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, Oct 25, 2016 at 2:49 PM, Amir Goldstein <amir73il@gmail.com> wrote:
>> @@ -880,31 +913,34 @@ static int ovl_rename(struct inode *olddir, struct dentry *old,
>> if (WARN_ON(olddentry->d_inode == newdentry->d_inode))
>> goto out_dput;
>>
>> - if (is_dir && !old_opaque && ovl_lower_positive(new)) {
>> - err = ovl_set_opaque(olddentry);
>> - if (err)
>> - goto out_dput;
>> - ovl_dentry_set_opaque(old, true);
>> + if (is_dir) {
>> + if (ovl_type_merge_or_lower(old)) {
>> + err = ovl_set_redirect(old);
>
> There is a fair chance of getting ENOSPC/EDQUOT here and confuse user space.
> Would it be better to convert these non fatal errors with EXDEV, so
> user space will
> gracefully fallback to recursive rename/clone/copy?
Recursive copy up will surely consume more space than an xattr?
>> @@ -162,6 +223,23 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
>> stack[ctr].dentry = this;
>> stack[ctr].mnt = lowerpath.mnt;
>> ctr++;
>> +
>> + if (!stop && i != poe->numlower - 1 &&
>> + d_is_dir(this) && ovl_redirect_dir(dentry->d_sb)) {
>> + err = ovl_check_redirect(this, &redirect);
>> + if (err)
>> + goto out_put;
>> +
>> + if (redirect && poe != dentry->d_sb->s_root->d_fsdata) {
>> + poe = dentry->d_sb->s_root->d_fsdata;
>> +
>
> Now you are about to continue looping until new value of poe->numlower,
> which is >= then olf value of poe->numlower, but 'stack' was allocated
> according to old value of poe->numlower, so aren't you in danger of
> overflowing it?
>
> Please add a comment to explain the purpose of this loop rewind.
We are jumping to a stack possibly wider than the current one and need
to find the layer where to continue the downward traversal. I'll add
the comment.
BTW I don't remember having tested this, so it might possibly be
buggy. Automatic multi-layer testing would really be good. What we
basically need is:
- create normal (two layer) overlay (with interesting constructs,
whiteout, opaque dir, redirect)
- umount
- create three layer overlay where the two lower layers come from the
previous upper/lower layers
- do more interesting things
There's one such test in xfstests but it would be good to have more.
Thanks,
Miklos
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/3] overlayfs: allow moving directory trees Miklos Szeredi <mszeredi@redhat.com> - 2016-10-25 09:40 +0200
[PATCH 3/3] ovl: redirect on rename-dir Miklos Szeredi <mszeredi@redhat.com> - 2016-10-25 09:40 +0200
Re: [PATCH 3/3] ovl: redirect on rename-dir Raphael Hertzog <hertzog@debian.org> - 2016-10-25 14:10 +0200
Re: [PATCH 3/3] ovl: redirect on rename-dir Miklos Szeredi <miklos@szeredi.hu> - 2016-10-26 13:20 +0200
Re: [PATCH 3/3] ovl: redirect on rename-dir Amir Goldstein <amir73il@gmail.com> - 2016-10-25 15:00 +0200
Re: [PATCH 3/3] ovl: redirect on rename-dir Miklos Szeredi <miklos@szeredi.hu> - 2016-10-26 13:30 +0200
Re: [PATCH 3/3] ovl: redirect on rename-dir Amir Goldstein <amir73il@gmail.com> - 2016-10-26 14:20 +0200
Re: [PATCH 3/3] ovl: redirect on rename-dir Miklos Szeredi <miklos@szeredi.hu> - 2016-10-26 15:00 +0200
Re: [PATCH 3/3] ovl: redirect on rename-dir Amir Goldstein <amir73il@gmail.com> - 2016-10-26 22:00 +0200
[PATCH 2/3] vfs: export vfs_path_lookup() Miklos Szeredi <mszeredi@redhat.com> - 2016-10-25 09:40 +0200
csiph-web