Skip to content

Cached ctimes/mtimes are not updated after altering them. #96

Open
@agusdallalba

Description

@agusdallalba

After you change a file's modification time (for example using touch) a later stat doesn't reflect this change—the ctime/mtime value seems to be cached. Actually modifiying the file does work as I expect. Here's an example:

$ gdfs -d .cache/gdfs /tmp/gdfs/
$ cd /tmp/gdfs
$ rm test
rm: cannot remove 'test': No such file or directory

Now let's make a file called 'test':

$ touch -t test
$ stat test
  File: 'test'
  Size: 0           Blocks: 0          IO Block: 4096   regular empty file
Device: 26h/38d Inode: 2           Links: 1
Access: (0666/-rw-rw-rw-)  Uid: ( 1000/ username)   Gid: (  100/   users)
Access: 2014-09-27 23:38:12.958362102 -0300
Modify: 2014-09-27 23:38:01.000000000 -0300
Change: 2014-09-27 23:38:01.000000000 -0300
 Birth: -

So far so good. Now let's change it and pretend it's 2014/Jan/01 at 00:00:

$ touch -t 201401010000 test
$ stat test
  File: 'test'
  Size: 0           Blocks: 0          IO Block: 4096   regular empty file
Device: 26h/38d Inode: 2           Links: 1
Access: (0666/-rw-rw-rw-)  Uid: ( 1000/ username)   Gid: (  100/   users)
Access: 2014-09-27 23:39:55.063636064 -0300
Modify: 2014-09-27 23:38:01.000000000 -0300
Change: 2014-09-27 23:38:01.000000000 -0300
 Birth: -

Only the access time has changed. However in the Google Drive website the file appears correctly as 'Modified 1 Jan by me'. And after remounting the times are correct:

$ cd ..; fusermount -u /tmp/gdfs; gdfs -d .cache/gdfs /tmp/gdfs/; cd /tmp/gdfs
$ stat test
  File: 'test'
  Size: 0           Blocks: 0          IO Block: 4096   regular empty file
Device: 26h/38d Inode: 2           Links: 1
Access: (0666/-rw-rw-rw-)  Uid: ( 1000/ agustin)   Gid: (  100/   users)
Access: 2014-09-27 23:42:20.539596080 -0300
Modify: 2014-01-01 00:00:00.000000000 -0300
Change: 2014-01-01 00:00:00.000000000 -0300
 Birth: -

touching the time again yields the same result. An actual modification to the file works as expected without remounting:

$ echo '' > test
stat test
[...]
Modify: 2014-09-27 23:44:34.000000000 -0300
Change: 2014-09-27 23:44:34.000000000 -0300
 Birth: -

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions