ovl: check whiteout on lowest layer as well

Not checking whiteouts on lowest layer was an optimization (there's nothing
to white out there), but it could result in inconsitent behavior when a
layer previously used as upper/middle is later used as lowest. 

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Этот коммит содержится в:
Miklos Szeredi
2014-12-13 00:59:45 +01:00
родитель 3d3c6b8939
Коммит 3e01cee3b9
2 изменённых файлов: 51 добавлений и 57 удалений

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

@@ -350,16 +350,12 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
if (IS_ERR(this))
goto out;
/*
* If this is not the lowermost layer, check whiteout and opaque
* directory.
*/
if (poe->numlower && this) {
if (this) {
if (ovl_is_whiteout(this)) {
dput(this);
this = NULL;
upperopaque = true;
} else if (ovl_is_opaquedir(this)) {
} else if (poe->numlower && ovl_is_opaquedir(this)) {
upperopaque = true;
}
}
@@ -384,19 +380,16 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
goto out_put;
if (!this)
continue;
/*
* If this is not the lowermost layer, check whiteout and opaque
* directory.
*/
if (i < poe->numlower - 1) {
if (ovl_is_whiteout(this)) {
dput(this);
break;
} else if (ovl_is_opaquedir(this)) {
opaque = true;
}
if (ovl_is_whiteout(this)) {
dput(this);
break;
}
/*
* Only makes sense to check opaque dir if this is not the
* lowermost layer.
*/
if (i < poe->numlower - 1 && ovl_is_opaquedir(this))
opaque = true;
/*
* If this is a non-directory then stop here.
*