From: Vivek Goyal <vgoyal@redhat.com>
To: linux-unionfs@vger.kernel.org, Miklos Szeredi <miklos@szeredi.hu>
Cc: Amir Goldstein <amir73il@gmail.com>, Daniel J Walsh <dwalsh@redhat.com>
Subject: [PATCH] overlayfs: Return error if metadata only copy-up can't be enabled
Date: Fri, 26 Oct 2018 09:43:33 -0400 [thread overview]
Message-ID: <20181026134333.GB17321@redhat.com> (raw)
Assume a user wanted to enable metadata only copy-up and passes metacopy=on.
If this feature can't be enabled, we disable metacopy=off and just leave
a warning in logs. metacopy=on requires redirect_dir=on (for upper dir)
or redirect_dir=follow (for non-upper mount).
As user does not see mount failure, he/she assumes metadata only copy-up
has been enabled but that's not the case.
So instead of disabling metacopy, return an error to user and leave a
message in logs. That will allow user to fix mount options and retry.
Reported-by: Daniel Walsh <dwalsh@redhat.com>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---
fs/overlayfs/super.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: rhvgoyal-linux/fs/overlayfs/super.c
===================================================================
--- rhvgoyal-linux.orig/fs/overlayfs/super.c 2018-10-26 09:07:46.474353806 -0400
+++ rhvgoyal-linux/fs/overlayfs/super.c 2018-10-26 09:28:23.195422393 -0400
@@ -574,11 +574,11 @@ static int ovl_parse_opt(char *opt, stru
/* metacopy feature with upper requires redirect_dir=on */
if (config->upperdir && config->metacopy && !config->redirect_dir) {
- pr_warn("overlayfs: metadata only copy up requires \"redirect_dir=on\", falling back to metacopy=off.\n");
- config->metacopy = false;
+ pr_err("overlayfs: metadata only copy up requires \"redirect_dir=on\".\n");
+ return -EINVAL;
} else if (config->metacopy && !config->redirect_follow) {
- pr_warn("overlayfs: metadata only copy up requires \"redirect_dir=follow\" on non-upper mount, falling back to metacopy=off.\n");
- config->metacopy = false;
+ pr_err("overlayfs: metadata only copy up requires either \"redirect_dir=follow\" or \"redirect_dir=on\" on non-upper mount.\n");
+ return -EINVAL;
}
return 0;
next reply other threads:[~2018-10-26 13:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-26 13:43 Vivek Goyal [this message]
2018-10-26 14:10 ` [PATCH] overlayfs: Return error if metadata only copy-up can't be enabled Miklos Szeredi
2018-10-26 14:16 ` Vivek Goyal
2018-10-26 14:28 ` Vivek Goyal
2018-10-26 15:40 ` Daniel Walsh
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=20181026134333.GB17321@redhat.com \
--to=vgoyal@redhat.com \
--cc=amir73il@gmail.com \
--cc=dwalsh@redhat.com \
--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).