Emmanuel Dreyfus
2014-09-03 15:46:04 UTC
Hi
When running regression tests on FUSE filesystems, I hit a i
race condition: when I create a node in a directory, the
parent directory mtime/ctime seems to be updated asynchronously,
and some tests that check it report an error because it has not
been updated at test time.
Here is a PoC:
stat -f '%m' . ; mkfifo x; stat -f '%m' . ; sleep 1; stat -f '%m' .
This gives the result:
1409757799
1409757799
1409757818
Which means that when mkfifo returns, the parent directory
mtime is not yet updated. If I wait one second I get it alrgiht.
I have trouble to understand where parent directory ctime/mtime is
updated; Anyone can tell me how this should work?
When running regression tests on FUSE filesystems, I hit a i
race condition: when I create a node in a directory, the
parent directory mtime/ctime seems to be updated asynchronously,
and some tests that check it report an error because it has not
been updated at test time.
Here is a PoC:
stat -f '%m' . ; mkfifo x; stat -f '%m' . ; sleep 1; stat -f '%m' .
This gives the result:
1409757799
1409757799
1409757818
Which means that when mkfifo returns, the parent directory
mtime is not yet updated. If I wait one second I get it alrgiht.
I have trouble to understand where parent directory ctime/mtime is
updated; Anyone can tell me how this should work?
--
Emmanuel Dreyfus
***@netbsd.org
Emmanuel Dreyfus
***@netbsd.org