From: Ian Lance Taylor Date: Fri, 29 Jun 2018 21:38:56 +0000 (-0700) Subject: os: increase directory reading block size on Unix systems X-Git-Tag: go1.11beta2~197 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=616da5da94aad1de2464e67e71d8eb1f4292f445;p=gostls13.git os: increase directory reading block size on Unix systems Reportedly CIFS on RHEL 7 can fail to report files if directories are read in 4K increments. While this seems to be a CIFS or RHEL bug, reportedly CIFS does not return more than 5760 bytes in a block, so reading in 8K increments should hide the problem from users with minimal cost. Fixes #24015 Change-Id: Iaf9f00ffe338d379c819ed9edcd4cc9834e3b0f7 Reviewed-on: https://go-review.googlesource.com/121756 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- diff --git a/src/os/dir_unix.go b/src/os/dir_unix.go index 09c3d2eb61..79d61c783f 100644 --- a/src/os/dir_unix.go +++ b/src/os/dir_unix.go @@ -13,7 +13,8 @@ import ( ) const ( - blockSize = 4096 + // More than 5760 to work around https://golang.org/issue/24015. + blockSize = 8192 ) func (f *File) readdir(n int) (fi []FileInfo, err error) {