From: Darrick J. Wong Date: Thu, 24 Apr 2025 21:44:25 +0000 (-0700) Subject: fuse2fs: disable renameat2 X-Git-Tag: archive/debian/1.47.2-2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb8fde1619e78b41894431d8e992d0230028b9e5;p=thirdparty%2Fe2fsprogs.git fuse2fs: disable renameat2 Apparently fuse munged rename and renameat2 together into the same upcall, so we actually have to filter out nonzero flags because otherwise we do a regular rename for a RENAME_EXCHANGE/WHITEOUT, which is not what the user asked for. Signed-off-by: Darrick J. Wong Link: https://lore.kernel.org/r/174553065177.1160461.684615549721279410.stgit@frogsfrogsfrogs Signed-off-by: Theodore Ts'o (cherry picked from commit b431abbc8fe0fd1de4e414aae3520c4c19411048) --- diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c index d123eebb..36e1173e 100644 --- a/misc/fuse2fs.c +++ b/misc/fuse2fs.c @@ -1405,6 +1405,12 @@ static int op_rename(const char *from, const char *to struct update_dotdot ud; int ret = 0; +#if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0) + /* renameat2 is not supported */ + if (flags) + return -ENOSYS; +#endif + FUSE2FS_CHECK_CONTEXT(ff); fs = ff->fs; dbg_printf("%s: renaming %s to %s\n", __func__, from, to);