linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chengguang Xu <cgxu519@mykernel.net>
To: miklos@szeredi.hu
Cc: linux-unionfs@vger.kernel.org, Chengguang Xu <cgxu519@mykernel.net>
Subject: [RFC Patch] ovl: skip delever fadvise request to lower layers
Date: Sat, 19 Mar 2022 13:38:28 +0800	[thread overview]
Message-ID: <20220319053828.2354927-1-cgxu519@mykernel.net> (raw)

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



                 reply	other threads:[~2022-03-19  5:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220319053828.2354927-1-cgxu519@mykernel.net \
    --to=cgxu519@mykernel.net \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).