提交 2386832f 编写于 作者: A Amir Goldstein 提交者: Yang Yingliang

ovl: fix wrong WARN_ON() in ovl_cache_update_ino()

stable inclusion
from linux-4.19.103
commit 65a876ee848b23170708648a418fe260d4c7ae3a

--------------------------------

commit 4c37e71b upstream.

The WARN_ON() that child entry is always on overlay st_dev became wrong
when we allowed this function to update d_ino in non-samefs setup with xino
enabled.

It is not true in case of xino bits overflow on a non-dir inode.  Leave the
WARN_ON() only for directories, where assertion is still true.

Fixes: adbf4f7e ("ovl: consistent d_ino for non-samefs with xino")
Cc: <stable@vger.kernel.org> # v4.17+
Signed-off-by: NAmir Goldstein <amir73il@gmail.com>
Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 7cd19d93
......@@ -507,7 +507,13 @@ static int ovl_cache_update_ino(struct path *path, struct ovl_cache_entry *p)
if (err)
goto fail;
WARN_ON_ONCE(dir->d_sb->s_dev != stat.dev);
/*
* Directory inode is always on overlay st_dev.
* Non-dir with ovl_same_dev() could be on pseudo st_dev in case
* of xino bits overflow.
*/
WARN_ON_ONCE(S_ISDIR(stat.mode) &&
dir->d_sb->s_dev != stat.dev);
ino = stat.ino;
} else if (xinobits && !OVL_TYPE_UPPER(type)) {
ino = ovl_remap_lower_ino(ino, xinobits,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册