The files in lower layers are shared with multiple overlayfs instances. so directly delever fadvise request to lower layers may cause interfears between instances. Signed-off-by: Chengguang Xu <cgxu519@xxxxxxxxxxxx> --- fs/overlayfs/file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index fa125feed0ff..7b51f3afef02 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c @@ -539,6 +539,9 @@ static int ovl_fadvise(struct file *file, loff_t offset, loff_t len, int advice) const struct cred *old_cred; int ret; + if (!ovl_inode_upper(file_inode(file))) + return 0; + ret = ovl_real_fdget(file, &real); if (ret) return ret; -- 2.27.0