[RFC Patch] ovl: skip delever fadvise request to lower layers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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






[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux