NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

PR/49033 CVS commit: src/tests/fs/vfs

The following reply was made to PR kern/49033; it has been noted by GNATS.

From: "Robert Elz" <>
Subject: PR/49033 CVS commit: src/tests/fs/vfs
Date: Mon, 29 Aug 2016 02:31:46 +0000

 Module Name:	src
 Committed By:	kre
 Date:		Mon Aug 29 02:31:46 UTC 2016
 Modified Files:
 	src/tests/fs/vfs: t_vnops.c
 Log Message:
 PR kern/49033
 POSIX allows for the atime (or technically, any of the times) to be
 updated as a side effect of searching a directory (allows, not requires).
 The NetBSD UDF implementation apparently works that way, treating a
 directory search as a read of the directory, and hence updating the
 access time.   Compensate for that in the test (rather than just
 expecting failure) by verifying that the atime after the directory
 search is within a small margin of the atime before the search
 (currently, "small" is 1 second).   We could fetch the time before
 the mkdir and both stat() calls, do all of that, fetch the time after,
 subtract, and require the after stat() atime to be bounded by the atime
 set by the original mkdir and returned in the first stat() and that time
 + the difference in elapsed time - that would be more accurate, but is
 a lot more work for little real benefit.
 Should anyone be interested in doing that extra work, remember to use
 monotonic time (clock_gettime(CLOCK_MOMNOTONIC, ...)) not the time of day
 clock for measuring the elapsed time.
 Along with this, remove the "if (udf) failure expected" and the
 if (udf && we haven't failed yet) fail("random failure failed to happen")
 stuff...  (the "random" would have been that sometimes the mkdir and
 two lookups (stat() calls) would all occur within the same clock tick,
 meaning that the atimes would all be the same.  Other times the clock
 would tick somewhere between the mkdir() and the 2nd stat().)
 To generate a diff of this commit:
 cvs rdiff -u -r1.57 -r1.58 src/tests/fs/vfs/t_vnops.c
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

Home | Main Index | Thread Index | Old Index