linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com>
To: Miklos Szeredi <miklos@szeredi.hu>, <linux-unionfs@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>,
	Amir Goldstein <amir73il@gmail.com>,
	Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com>
Subject: [PATCH] ovl: do not set overlay.opaque for new directories
Date: Mon,  3 May 2021 20:42:58 +0200	[thread overview]
Message-ID: <20210503184258.96714-1-Vyacheslav.Yurkov@bruker.com> (raw)

This optimization breaks existing use case when a lower layer directory
appears after directory was created on a merged layer. If overlay.opaque
is applied, new files on lower layer are not visible.

Consider the following scenario:
- /lower and /upper are mounted to /merged
- directory /merged/new-dir is created with a file test1
- overlay is unmounted
- directory /lower/new-dir is created with a file test2
- overlay is mounted again

If opaque is applied by default, file test2 is not going to be visible
without explicitly clearing the overlay.opaque attribute

Signed-off-by: Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com>
---
 fs/overlayfs/dir.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c
index 93efe7048a77..f66f96dd9f0c 100644
--- a/fs/overlayfs/dir.c
+++ b/fs/overlayfs/dir.c
@@ -338,11 +338,6 @@ static int ovl_create_upper(struct dentry *dentry, struct inode *inode,
 	if (IS_ERR(newdentry))
 		goto out_unlock;
 
-	if (ovl_type_merge(dentry->d_parent) && d_is_dir(newdentry)) {
-		/* Setting opaque here is just an optimization, allow to fail */
-		ovl_set_opaque(dentry, newdentry);
-	}
-
 	err = ovl_instantiate(dentry, inode, newdentry, !!attr->hardlink);
 	if (err)
 		goto out_cleanup;
-- 
2.25.1


             reply	other threads:[~2021-05-03 18:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03 18:42 Vyacheslav Yurkov [this message]
2021-05-25  8:31 ` [PATCH] ovl: do not set overlay.opaque for new directories Amir Goldstein
2021-05-27 12:18   ` Yurkov, Vyacheslav

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=20210503184258.96714-1-Vyacheslav.Yurkov@bruker.com \
    --to=vyacheslav.yurkov@bruker.com \
    --cc=amir73il@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --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).