[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <175798162467.391272.227746098617279902.stgit@frogsfrogsfrogs>
Date: Mon, 15 Sep 2025 18:05:16 -0700
From: "Darrick J. Wong" <djwong@...nel.org>
To: tytso@....edu
Cc: miklos@...redi.hu, neal@...pa.dev, linux-fsdevel@...r.kernel.org,
linux-ext4@...r.kernel.org, John@...ves.net, bernd@...ernd.com,
joannelkoong@...il.com
Subject: [PATCH 07/10] fuse2fs: add tracing for retrieving timestamps
From: Darrick J. Wong <djwong@...nel.org>
Add tracing for retrieving timestamps so we can debug the weird
behavior.
Signed-off-by: "Darrick J. Wong" <djwong@...nel.org>
---
misc/fuse2fs.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index fa4359133a79fc..00dafec79f7766 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -1580,9 +1580,11 @@ static void *op_init(struct fuse_conn_info *conn,
return ff;
}
-static int stat_inode(ext2_filsys fs, ext2_ino_t ino, struct stat *statbuf)
+static int fuse2fs_stat(struct fuse2fs *ff, ext2_ino_t ino,
+ struct stat *statbuf)
{
struct ext2_inode_large inode;
+ ext2_filsys fs = ff->fs;
dev_t fakedev = 0;
errcode_t err;
int ret = 0;
@@ -1621,6 +1623,13 @@ static int stat_inode(ext2_filsys fs, ext2_ino_t ino, struct stat *statbuf)
#else
statbuf->st_ctime = tv.tv_sec;
#endif
+
+ dbg_printf(ff, "%s: ino=%d atime=%lld.%ld mtime=%lld.%ld ctime=%lld.%ld\n",
+ __func__, ino,
+ (long long int)statbuf->st_atim.tv_sec, statbuf->st_atim.tv_nsec,
+ (long long int)statbuf->st_mtim.tv_sec, statbuf->st_mtim.tv_nsec,
+ (long long int)statbuf->st_ctim.tv_sec, statbuf->st_ctim.tv_nsec);
+
if (LINUX_S_ISCHR(inode.i_mode) ||
LINUX_S_ISBLK(inode.i_mode)) {
if (inode.i_block[0])
@@ -1667,16 +1676,15 @@ static int op_getattr(const char *path, struct stat *statbuf,
struct fuse_file_info *fi)
{
struct fuse2fs *ff = fuse2fs_get();
- ext2_filsys fs;
ext2_ino_t ino;
int ret = 0;
FUSE2FS_CHECK_CONTEXT(ff);
- fs = fuse2fs_start(ff);
+ fuse2fs_start(ff);
ret = fuse2fs_file_ino(ff, path, fi, &ino);
if (ret)
goto out;
- ret = stat_inode(fs, ino, statbuf);
+ ret = fuse2fs_stat(ff, ino, statbuf);
out:
fuse2fs_finish(ff, ret);
return ret;
@@ -3409,7 +3417,7 @@ static int fuse2fs_file_uses_iomap(struct fuse2fs *ff, ext2_ino_t ino)
if (!fuse2fs_iomap_enabled(ff))
return 0;
- ret = stat_inode(ff->fs, ino, &statbuf);
+ ret = fuse2fs_stat(ff, ino, &statbuf);
if (ret)
return ret;
@@ -4311,7 +4319,7 @@ static int op_readdir_iter(ext2_ino_t dir EXT2FS_ATTR((unused)),
(unsigned long long)i->dirpos);
if (i->flags == FUSE_READDIR_PLUS) {
- ret = stat_inode(i->fs, dirent->inode, &stat);
+ ret = fuse2fs_stat(i->ff, dirent->inode, &stat);
if (ret)
return DIRENT_ABORT;
}
Powered by blists - more mailing lists