[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240815092429.103356-10-aleksandr.mikhalitsyn@canonical.com>
Date: Thu, 15 Aug 2024 11:24:26 +0200
From: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@...onical.com>
To: mszeredi@...hat.com
Cc: brauner@...nel.org,
stgraber@...raber.org,
linux-fsdevel@...r.kernel.org,
Seth Forshee <sforshee@...nel.org>,
Miklos Szeredi <miklos@...redi.hu>,
Amir Goldstein <amir73il@...il.com>,
Bernd Schubert <bschubert@....com>,
Alexander Mikhalitsyn <aleksandr.mikhalitsyn@...onical.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH v3 09/11] fs/fuse: properly handle idmapped ->rename op
Support of RENAME_WHITEOUT with idmapped mounts requires
an API extension for FUSE_RENAME2.
Let's just forbid this combination for now. It's not
critical at all as it's only needed for overlayfs on top
of fuse/virtiofs.
Choice of EINVAL is not random, we just simulate a standard
behavior when RENAME_WHITEOUT flag is not supported.
Cc: Christian Brauner <brauner@...nel.org>
Cc: Seth Forshee <sforshee@...nel.org>
Cc: Miklos Szeredi <miklos@...redi.hu>
Cc: Amir Goldstein <amir73il@...il.com>
Cc: Bernd Schubert <bschubert@....com>
Cc: <linux-fsdevel@...r.kernel.org>
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@...onical.com>
---
v2:
- this commit added
---
fs/fuse/dir.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index c50f951596dd..0cd01f25251f 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -1111,6 +1111,9 @@ static int fuse_rename2(struct mnt_idmap *idmap, struct inode *olddir,
if (flags & ~(RENAME_NOREPLACE | RENAME_EXCHANGE | RENAME_WHITEOUT))
return -EINVAL;
+ if ((flags & RENAME_WHITEOUT) && (idmap != &nop_mnt_idmap))
+ return -EINVAL;
+
if (flags) {
if (fc->no_rename2 || fc->minor < 23)
return -EINVAL;
--
2.34.1
Powered by blists - more mailing lists