From: Darrick J. Wong Date: Sun, 6 Jul 2025 18:32:03 +0000 (-0700) Subject: fuse2fs: don't truncate when creating a new file X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3a1437758398e8adcd141aabb7c572af8ef356a;p=thirdparty%2Fe2fsprogs.git fuse2fs: don't truncate when creating a new file New files can't have contents, so there's no need to truncate them, which then messes with ctime/mtime. Cc: linux-ext4@vger.kernel.org # v1.43 Fixes: 81cbf1ef4f5dab ("misc: add fuse2fs, a FUSE server for e2fsprogs") Signed-off-by: Darrick J. Wong Link: https://lore.kernel.org/r/175182663059.1984706.11656403223439904537.stgit@frogsfrogsfrogs Signed-off-by: Theodore Ts'o --- diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c index 0e9576b6..5b866aed 100644 --- a/misc/fuse2fs.c +++ b/misc/fuse2fs.c @@ -3376,6 +3376,7 @@ static int op_create(const char *path, mode_t mode, struct fuse_file_info *fp) if (ret) goto out2; + fp->flags &= ~O_TRUNC; ret = __op_open(ff, path, fp); if (ret) goto out2;