* [RFC Patch] ovl: skip delever fadvise request to lower layers
@ 2022-03-19 5:38 Chengguang Xu
0 siblings, 0 replies; only message in thread
From: Chengguang Xu @ 2022-03-19 5:38 UTC (permalink / raw)
To: miklos; +Cc: linux-unionfs, Chengguang Xu
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@mykernel.net>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-19 5:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-19 5:38 [RFC Patch] ovl: skip delever fadvise request to lower layers Chengguang Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).