mtime is older that atime on prl_fs partition

Discussion in 'Linux Virtual Machine' started by MarcinK5, Sep 24, 2021.

  1. MarcinK5

    MarcinK5 Bit poster

    Messages:
    2
    Hi guys,

    I wanted to use the folder sharing feature to share source code between my Mac OS X host & a linux VM which is used to compile all this stuff into an embedded linux system image using Buildroot.
    Some of the packages use autotools to automatically detect when a rebuild is necessary.
    The problem arises when a file's mtime & atime are not correctly updated, triggering a rebuild when it was not necessary.

    I have tracked this down because that same code builds successfully on an ext4 partition.

    Here's my test scenario: touch a file & inspect it's atime & mtime using stat. Then modify the contents of the file using nano & re-inspecting atime & mtime.

    This is the result on an ext4 partition:
    marcin@linux:~$ touch test
    marcin@linux:~$ stat test

    File: test
    Size: 0 Blocks: 0 IO Block: 4096 regular empty file
    Device: 802h/2050d Inode: 3934465 Links: 1
    Access: (0664/-rw-rw-r--) Uid: ( 1000/ marcin) Gid: ( 1000/ marcin)
    Access: 2021-09-21 23:21:21.633600878 +0200
    Modify: 2021-09-21 23:21:21.633600878 +0200
    Change: 2021-09-21 23:21:21.633600878 +0200
    Birth: 2021-09-21 23:21:21.633600878 +0200
    marcin@linux:~$ nano test
    marcin@linux:~$ stat test

    File: test
    Size: 2 Blocks: 8 IO Block: 4096 regular file
    Device: 802h/2050d Inode: 3934465 Links: 1
    Access: (0664/-rw-rw-r--) Uid: ( 1000/ marcin) Gid: ( 1000/ marcin)
    Access: 2021-09-21 23:21:33.397639747 +0200
    Modify: 2021-09-21 23:21:36.637650465 +0200
    Change: 2021-09-21 23:21:36.637650465 +0200
    Birth: 2021-09-21 23:21:21.633600878 +0200

    And now on a prl_fs partition:
    marcin@linux:/media/psf/$ touch test
    marcin@linux:/media/psf/$ stat test

    File: test
    Size: 0 Blocks: 0 IO Block: 4096 regular empty file
    Device: 39h/57d Inode: 309064 Links: 1
    Access: (0664/-rw-rw-r--) Uid: ( 1000/ marcin) Gid: ( 1000/ marcin)
    Access: 2021-09-21 23:20:03.000000000 +0200
    Modify: 2021-09-21 23:20:03.000000000 +0200
    Change: 2021-09-21 23:20:03.000000000 +0200
    Birth: -
    marcin@linux:/media/psf/$ nano test
    marcin@linux:/media/psf/$ stat test

    File: test
    Size: 2 Blocks: 8 IO Block: 4096 regular file
    Device: 39h/57d Inode: 309064 Links: 1
    Access: (0664/-rw-rw-r--) Uid: ( 1000/ marcin) Gid: ( 1000/ marcin)
    Access: 2021-09-21 23:20:29.000000000 +0200
    Modify: 2021-09-21 23:20:28.000000000 +0200
    Change: 2021-09-21 23:20:28.000000000 +0200
    Birth: -

    As you can see, only atime was updated on the prf_fs partition while the contents have changed!

    Am I the only one with this issue?
    Can you reproduce this on your end?

    I have glanced over the source code and it seems it would be possible to patch this but I'm having trouble figuring out where & what to patch

    Thanks!
     
  2. MarcinK5

    MarcinK5 Bit poster

    Messages:
    2
    EDIT: mtime & atime are indeed both modified but mtime is older than atime.
    Is this due to the driver reading that file & deciding if it needs to be synchronized back to the host?
     

Share This Page