ovl: Do not expose metacopy only dentry from d_real()

Metacopy dentry/inode is internal to overlay and is never exposed outside
of it.  Exception is metacopy upper file used for fsync().  Modify d_real()
to look for dentries/inode which have data, but also allow matching upper
inode without data for the fsync case.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
Vivek Goyal 2018-05-11 11:49:31 -04:00 коммит произвёл Miklos Szeredi
Родитель 8c444d2a97
Коммит 2c3d73589a
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -95,10 +95,13 @@ static struct dentry *ovl_d_real(struct dentry *dentry,
}
real = ovl_dentry_upper(dentry);
if (real && (!inode || inode == d_inode(real)))
if (real && (inode == d_inode(real)))
return real;
real = ovl_dentry_lower(dentry);
if (real && !inode && ovl_has_upperdata(d_inode(dentry)))
return real;
real = ovl_dentry_lowerdata(dentry);
if (!real)
goto bug;