mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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 <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
8d5fd871d7
commit
616da5da94
1 changed files with 2 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue