summaryrefslogtreecommitdiffstats
path: root/usr.bin/touch
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-10-16 19:30:48 +0000
committerjhb <jhb@FreeBSD.org>2009-10-16 19:30:48 +0000
commit205158c2d7e4e1cde4558ae29461315932de3454 (patch)
tree757e27bd801507091ea775054421bfcf33ffb83a /usr.bin/touch
parent52bf80a1c9ceda3e118d67b2683cdb3b402a1a18 (diff)
downloadFreeBSD-src-205158c2d7e4e1cde4558ae29461315932de3454.zip
FreeBSD-src-205158c2d7e4e1cde4558ae29461315932de3454.tar.gz
Close a race with caching of -ve name lookups in the NFS client.
Specifically, clients only trust -ve cache entries while the directory remains unchanged and discard any -ve cache entries for a directory when they notice that the modification time of a directory entry changes. The race involves two concurrent lookups as follows: - Thread A does a lookup for file 'foo' which sends a lookup RPC to the server. The lookup fails and the server replies. - The 'foo' file is created (either by the same client or a different client) updating the modification time on the parent directory of 'foo'. - Thread B does a lookup for a different file 'bar' which updates the cached attributes of the parent directory of 'foo' to reflect the new modification time after 'foo' was created. - Thread A finally resumes execution to parse the reply from the NFS server. It adds a -ve cache entry and sets the cached value of the directory's modification time that is used for invalidating -ve cached lookups to the new modification time set by thread B. At this point, future lookups of 'foo' will honor the -ve cached entry until the cached entry is pushed out of the name cache's LRU or the modification time of the parent directory is changed again by some other change. The fix is to read the directory's modification time before sending the lookup RPC and use that cached modification time when setting the directory's cached modification time. Also, we do not add a -ve cache entry if another thread has added -ve cache entry that set the directory's cached modification time to a newer value than the value we read before sending the lookup RPC. Reviewed by: rmacklem MFC after: 1 week
Diffstat (limited to 'usr.bin/touch')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud