When called from vrecycle() or vgone() there is a window where the refcount
is greater than zero and another thread could get and release a reference
that would miss VOP_INACTIVE() as the refcount doesn't drop to zero.
Adjust test fs/puffs/t_basic: test VOP_INACTIVE count being greater zero.
- Make vrecycle() more robust by checking v_usecount first and preventing
further references across vn_lock(). Fixes a deadlock where one thread
starts unmount, second thread locks a directory and allocates a vnode
and first thread tries to vrecycle() the directory.
First thread holds vfs_busy and wants vnode, second thread holds vnode
and wants vfs_busy.
- With these fixes in place change cleanvnode() to use vget()/vrecycle()
to reclaim the vnode.
sometimes times out under qemu under Linux, where the timing is more
accurate than under qemu under NetBSD where the the 60 second timeout
typically takes more than 60 seconds to trigger.
When a process attempts to read from an empty file originating from
psshfs mount, it waits indefinitely. Until the hanged process is
interrupted, the mounted filesystem appears to work as expected,
except for the directory containing the empty file. Processes trying
to list that directory also hang, and cause misbehaviour of the
containing directory. It is possible to create a chain of hanged
processes trying to read directories up to the mount point. At the
same time, psshfs generates some network traffic (around 5KB/s, in
my case). Interrupting the first hanged process causes emission of
an error message by all other hanged processes, and psshfs ceases
to generate network traffic. Subsequent trials to list any affected
directory or if one of the affected directories is the mount point
to unmount the filesystem, fail with the same error.
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().)
case. Instead, add a separate test case "create_nonalphanum" for
filenames containing non-alphanumeric characters. The bug of
PR kern/50608 now causes a failure in create_nonalphanum rather than
create_many.
st_mtimespec is our traditional nonstandard name for what POSIX
called st_mtim in 2008, but these aren't going to run in non-NetBSD
anyway so using the nonstandard name shouldn't be an issue.