mafintosh/fuse-bindings

utimens atime/mtime parameters jumping about non-monotonically

davidknoll opened this issue · 2 comments

If I repeatedly touch the same file, then rather than increasing by a few seconds each time to match the current time, the atime and mtime my utimens function receives are jumping about (in either direction) by as much as 15 minutes, and may be several minutes ahead of (I haven't seen behind) the current time as returned by Date.now(), which is used for ctime. My system's clock is correct.

At the beginning of my utimens function, I have an optional debug output that shows the parameters, before I do anything else with them. The problem shows here, as well as in the output of the stat command once those times have been saved.

Below I have attempted to demonstrate this in an orderly way.

david@flashheart:/repo-clones/mongofuse/mnt$ for i in seq 1 30; do touch testing; sleep 1; stat testing; sleep 1; done
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:28:49.020000000 +0100
Modify: 2016-10-02 21:28:49.020000000 +0100
Change: 2016-10-02 21:17:52.661000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:29:48.020000000 +0100
Modify: 2016-10-02 21:29:48.020000000 +0100
Change: 2016-10-02 21:17:54.720000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:30:45.020000000 +0100
Modify: 2016-10-02 21:30:45.020000000 +0100
Change: 2016-10-02 21:17:56.773000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:31:42.020000000 +0100
Modify: 2016-10-02 21:31:42.020000000 +0100
Change: 2016-10-02 21:17:58.830000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:32:40.019000000 +0100
Modify: 2016-10-02 21:32:40.019000000 +0100
Change: 2016-10-02 21:18:00.884000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:33:37.019000000 +0100
Modify: 2016-10-02 21:33:37.019000000 +0100
Change: 2016-10-02 21:18:02.940000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:34:38.019000000 +0100
Modify: 2016-10-02 21:34:38.019000000 +0100
Change: 2016-10-02 21:18:04.999000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:19:00.019000000 +0100
Modify: 2016-10-02 21:19:00.019000000 +0100
Change: 2016-10-02 21:18:07.059000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:19:47.019000000 +0100
Modify: 2016-10-02 21:19:47.019000000 +0100
Change: 2016-10-02 21:18:09.103000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:20:43.019000000 +0100
Modify: 2016-10-02 21:20:43.019000000 +0100
Change: 2016-10-02 21:18:11.157000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:21:43.019000000 +0100
Modify: 2016-10-02 21:21:43.019000000 +0100
Change: 2016-10-02 21:18:13.216000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:22:46.019000000 +0100
Modify: 2016-10-02 21:22:46.019000000 +0100
Change: 2016-10-02 21:18:15.276000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:23:46.019000000 +0100
Modify: 2016-10-02 21:23:46.019000000 +0100
Change: 2016-10-02 21:18:17.334000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:24:46.019000000 +0100
Modify: 2016-10-02 21:24:46.019000000 +0100
Change: 2016-10-02 21:18:19.392000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:25:33.019000000 +0100
Modify: 2016-10-02 21:25:33.019000000 +0100
Change: 2016-10-02 21:18:21.436000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:26:28.019000000 +0100
Modify: 2016-10-02 21:26:28.019000000 +0100
Change: 2016-10-02 21:18:23.490000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:27:23.018000000 +0100
Modify: 2016-10-02 21:27:23.018000000 +0100
Change: 2016-10-02 21:18:25.543000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:28:17.018000000 +0100
Modify: 2016-10-02 21:28:17.018000000 +0100
Change: 2016-10-02 21:18:27.594000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:29:11.018000000 +0100
Modify: 2016-10-02 21:29:11.018000000 +0100
Change: 2016-10-02 21:18:29.646000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:30:05.018000000 +0100
Modify: 2016-10-02 21:30:05.018000000 +0100
Change: 2016-10-02 21:18:31.698000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:31:00.018000000 +0100
Modify: 2016-10-02 21:31:00.018000000 +0100
Change: 2016-10-02 21:18:33.752000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:31:58.018000000 +0100
Modify: 2016-10-02 21:31:58.018000000 +0100
Change: 2016-10-02 21:18:35.808000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:32:55.018000000 +0100
Modify: 2016-10-02 21:32:55.018000000 +0100
Change: 2016-10-02 21:18:37.863000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:33:53.018000000 +0100
Modify: 2016-10-02 21:33:53.018000000 +0100
Change: 2016-10-02 21:18:39.918000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:34:47.018000000 +0100
Modify: 2016-10-02 21:34:47.018000000 +0100
Change: 2016-10-02 21:18:41.971000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:19:07.018000000 +0100
Modify: 2016-10-02 21:19:07.018000000 +0100
Change: 2016-10-02 21:18:44.029000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:20:05.018000000 +0100
Modify: 2016-10-02 21:20:05.018000000 +0100
Change: 2016-10-02 21:18:46.084000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:21:03.018000000 +0100
Modify: 2016-10-02 21:21:03.018000000 +0100
Change: 2016-10-02 21:18:48.139000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:22:03.017000000 +0100
Modify: 2016-10-02 21:22:03.017000000 +0100
Change: 2016-10-02 21:18:50.198000000 +0100
Birth: -
File: 'testing'
Size: 9 Blocks: 0 IO Block: 4096 regular file
Device: 27h/39d Inode: 6 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ david) Gid: ( 1000/ david)
Access: 2016-10-02 21:23:04.017000000 +0100
Modify: 2016-10-02 21:23:04.017000000 +0100
Change: 2016-10-02 21:18:52.257000000 +0100
Birth: -
david@flashheart:
/repo-clones/mongofuse/mnt$

Is this related to #58