lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <174553065051.1160461.5080284869849276746.stgit@frogsfrogsfrogs>
Date: Thu, 24 Apr 2025 14:42:36 -0700
From: "Darrick J. Wong" <djwong@...nel.org>
To: tytso@....edu
Cc: linux-ext4@...r.kernel.org
Subject: [PATCH 07/16] fuse2fs: report nanoseconds resolution through getattr

From: Darrick J. Wong <djwong@...nel.org>

Report the nanonseconds component of timestamps via getattr, and tell
fuse that we actually support nanosecond granularity.

Signed-off-by: "Darrick J. Wong" <djwong@...nel.org>
---
 misc/fuse2fs.c |    6 ++++++
 1 file changed, 6 insertions(+)


diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index d56d51207d1f25..bf4e592e7d2782 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -586,6 +586,9 @@ static void *op_init(struct fuse_conn_info *conn
 	dbg_printf(ff, "%s: dev=%s\n", __func__, fs->device_name);
 #ifdef FUSE_CAP_IOCTL_DIR
 	conn->want |= FUSE_CAP_IOCTL_DIR;
+#endif
+#if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0)
+	conn->time_gran = 1;
 #endif
 	if (fs->flags & EXT2_FLAG_RW) {
 		fs->super->s_mnt_count++;
@@ -635,10 +638,13 @@ static int stat_inode(ext2_filsys fs, ext2_ino_t ino, struct stat *statbuf)
 						(struct ext2_inode *)&inode);
 	EXT4_INODE_GET_XTIME(i_atime, &tv, &inode);
 	statbuf->st_atime = tv.tv_sec;
+	statbuf->st_atim.tv_nsec = tv.tv_nsec;
 	EXT4_INODE_GET_XTIME(i_mtime, &tv, &inode);
 	statbuf->st_mtime = tv.tv_sec;
+	statbuf->st_mtim.tv_nsec = tv.tv_nsec;
 	EXT4_INODE_GET_XTIME(i_ctime, &tv, &inode);
 	statbuf->st_ctime = tv.tv_sec;
+	statbuf->st_ctim.tv_nsec = tv.tv_nsec;
 	if (LINUX_S_ISCHR(inode.i_mode) ||
 	    LINUX_S_ISBLK(inode.i_mode)) {
 		if (inode.i_block[0])


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ