[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <175279461792.716436.14623391892076767727.stgit@frogsfrogsfrogs>
Date: Thu, 17 Jul 2025 16:46:25 -0700
From: "Darrick J. Wong" <djwong@...nel.org>
To: tytso@....edu
Cc: joannelkoong@...il.com, miklos@...redi.hu, John@...ves.net,
linux-fsdevel@...r.kernel.org, bernd@...ernd.com, linux-ext4@...r.kernel.org,
neal@...pa.dev
Subject: [PATCH 04/10] fuse2fs: better debugging for file mode updates
From: Darrick J. Wong <djwong@...nel.org>
Improve the tracing of a chmod operation so that we can debug file mode
updates.
Signed-off-by: "Darrick J. Wong" <djwong@...nel.org>
---
misc/fuse2fs.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index e580622d39b1d1..f2cb44a4e53b4c 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -2964,12 +2964,13 @@ static int op_chmod(const char *path, mode_t mode
#endif
)
{
+ struct ext2_inode_large inode;
struct fuse_context *ctxt = fuse_get_context();
struct fuse2fs *ff = (struct fuse2fs *)ctxt->private_data;
ext2_filsys fs;
errcode_t err;
ext2_ino_t ino;
- struct ext2_inode_large inode;
+ mode_t new_mode;
int ret = 0;
FUSE2FS_CHECK_CONTEXT(ff);
@@ -3008,11 +3009,12 @@ static int op_chmod(const char *path, mode_t mode
mode &= ~S_ISGID;
}
- inode.i_mode &= ~0xFFF;
- inode.i_mode |= mode & 0xFFF;
+ new_mode = (inode.i_mode & ~0xFFF) | (mode & 0xFFF);
- dbg_printf(ff, "%s: path=%s new_mode=0%o ino=%d\n", __func__,
- path, inode.i_mode, ino);
+ dbg_printf(ff, "%s: path=%s old_mode=0%o new_mode=0%o ino=%d\n",
+ __func__, path, inode.i_mode, new_mode, ino);
+
+ inode.i_mode = new_mode;
ret = update_ctime(fs, ino, &inode);
if (ret)
Powered by blists - more mailing lists