https://bugs.dragonflybsd.org/https://bugs.dragonflybsd.org/favicon.ico?16293952082011-04-25T11:17:40ZDragonFlyBSD bugtrackerDragonFlyBSD - Bug #2056: HAMMER does not update file access time after readhttps://bugs.dragonflybsd.org/issues/2056?journal_id=98462011-04-25T11:17:40Zswildner
<ul></ul><p>It actually is in the standard, I just didn't find it directly:</p>
<p><a class="external" href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html">http://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html</a></p>
<p>"Upon successful completion, where nbyte is greater than 0, read() shall mark <br />for update the last data access timestamp of the file, and shall return the <br />number of bytes read."</p>
<p>S.</p> DragonFlyBSD - Bug #2056: HAMMER does not update file access time after readhttps://bugs.dragonflybsd.org/issues/2056?journal_id=99902011-07-08T17:42:54Zalexh
<ul></ul><p>I'll take a look at implementing this, it should be pretty straight forward.</p>
<p>Cheers,<br />Alex</p> DragonFlyBSD - Bug #2056: HAMMER does not update file access time after readhttps://bugs.dragonflybsd.org/issues/2056?journal_id=99942011-07-08T18:11:06Zalexh
<ul></ul><p>The code is in hammer_vop_read:</p>
<pre><code>/*
* XXX only update the atime if we had to get the MP lock.
* XXX hack hack hack, fixme.<br /> */<br /> if (got_fstoken) {<br /> if ((ip->flags & HAMMER_INODE_RO) 0 &&<br /> (ip->hmp->mp->mnt_flag & MNT_NOATIME) 0) {<br /> ip->ino_data.atime = trans.time;<br /> hammer_modify_inode(&trans, ip, HAMMER_INODE_ATIME);<br /> }<br /> hammer_done_transaction(&trans);<br /> lwkt_reltoken(&hmp->fs_token);<br /> }<br /> return (error);</code></pre>
<p>It seems that the atime is only updated sometimes. This is horribly inconsistent<br />behaviour. Matt needs to look at this one, too. I've not the slightest clue why<br />such a hackish behaviour.</p>
<p>Regards,<br />Alex</p> DragonFlyBSD - Bug #2056: HAMMER does not update file access time after readhttps://bugs.dragonflybsd.org/issues/2056?journal_id=99952011-07-10T01:37:36Zdillon
<ul></ul><p>I have committed a change to master to hopefully make atime updates more<br />consistent. The code that was in there was an attempt to optimize the<br />concurrency path for read()'s for the case where the buffer cache buffers are<br />already cached.</p>
<p>Please test.</p>
<p>-Matt</p> DragonFlyBSD - Bug #2056: HAMMER does not update file access time after readhttps://bugs.dragonflybsd.org/issues/2056?journal_id=110032012-09-01T13:31:08Zmarino
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li></ul><p>Both hammer and UFS give the same result given the provided test (as would be expected).</p>