Unlike /dev/null, /dev/random calls trivfs_set_atime and trivfs_set_mtime with
every read/update which underneath calls file_utimens, spams and 
completely ignores relatime.

If one wants to see this behavious "in action" one can just repeatedly call:

stat /dev/random

inside Hurd and every time one does that all three timestamps will come back 
updated.

Worse if one instruments file_utimens one will see that just during the login 
process
we get hundreds of ATIME updates for /dev/random due to background entropy.

With this patch, extraneous updates are removed and spam is drastically reduced.
---
 trans/random.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/trans/random.c b/trans/random.c
index 5142cb15..74874c9f 100644
--- a/trans/random.c
+++ b/trans/random.c
@@ -357,7 +357,6 @@ trivfs_S_io_read (struct trivfs_protid *cred,
     }
 
   *data_len = amount;
-  trivfs_set_atime (fsys);
   return 0;
 
  errout:
@@ -390,7 +389,6 @@ trivfs_S_io_write (struct trivfs_protid *cred,
 
   pool_add_entropy (data, datalen);
   *amount = datalen;
-  trivfs_set_mtime (fsys);
   return 0;
 }
 
-- 
2.51.0


Reply via email to