From: Alois Wohlschlager <alois1@gmx-topmail.de>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] ovl: warn if trusted xattr creation fails
Date: Thu, 03 Feb 2022 12:02:46 +0100 [thread overview]
Message-ID: <2783448.iqOl4yHqVZ@genesis> (raw)
[-- Attachment #1: Type: text/plain, Size: 1474 bytes --]
When mounting overlayfs in an unprivileged user namespace, trusted xattr
creation will fail. This will lead to failures in some file operations,
e.g. in the following situation:
mkdir lower upper work merged
mkdir lower/directory
mount -toverlay -olowerdir=lower,upperdir=upper,workdir=work none merged
rmdir merged/directory
mkdir merged/directory
The last mkdir will fail:
mkdir: cannot create directory 'merged/directory': Input/output error
The cause for these failures is currently extremely non-obvious and hard
to debug. Hence, warn the user and suggest using the userxattr mount
option, if it is not already supplied and xattr creation fails during
the self-check.
Signed-off-by: Alois Wohlschlager <alois1@gmx-topmail.de>
---
fs/overlayfs/super.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 7bb0a47cb615..11123fe967e0 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1427,6 +1427,8 @@ static int ovl_make_workdir(struct super_block *sb,
struct ovl_fs *ofs,
ofs->config.xino = OVL_XINO_OFF;
pr_warn("upper fs does not support xattr,
falling back to xino=off.\n");
}
+ if (!ofs->config.userxattr)
+ pr_warn("trusted xattr creation not
supported, some file operations may fail. Try mounting with userxattr next
time.\n");
err = 0;
} else {
ovl_do_removexattr(ofs, ofs->workdir, OVL_XATTR_OPAQUE);
--
2.35.1
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next reply other threads:[~2022-02-03 11:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-03 11:02 Alois Wohlschlager [this message]
2022-02-21 11:11 ` [PATCH] ovl: warn if trusted xattr creation fails Miklos Szeredi
2022-02-26 18:15 ` Alois Wohlschlager
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=2783448.iqOl4yHqVZ@genesis \
--to=alois1@gmx-topmail.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.