]> Cypherpunks repositories - gostls13.git/commit
os: seek should invalidate any cached directory reads
authorKeith Randall <khr@golang.org>
Wed, 12 Feb 2020 01:49:52 +0000 (17:49 -0800)
committerKeith Randall <khr@golang.org>
Sun, 1 Mar 2020 22:26:33 +0000 (22:26 +0000)
commit529988d62c1ffc3e5332231fc3e977858e5a2351
treeb53302ce0c78c13e2c33ebbd88b4e49d8f4f0b21
parenta4f7b0879c8d5d67e8e186dc210d3c8e76589e78
os: seek should invalidate any cached directory reads

When we seek on the underlying FD, discard any directory entries
we've already read and cached. This makes sure we won't return
the same entry twice.

We already fixed this for Darwin in CL 209961.

Fixes #37161

Change-Id: I20e1ac8d751443135e67fb4c43c18d69befb643b
Reviewed-on: https://go-review.googlesource.com/c/go/+/219143
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/os/dir_darwin.go
src/os/dir_unix.go
src/os/file_unix.go
src/os/os_test.go
src/os/testdata/issue37161/a [new file with mode: 0644]
src/os/testdata/issue37161/b [new file with mode: 0644]
src/os/testdata/issue37161/c [new file with mode: 0644]