mount: change maximum leaf name length to 1024 bytes - fixes #3884

This limit was previously 4k set in 59026c4761 however leaf
names above 1k now produce an IO error.

WinFSP seems to have its own method for dropping too long file names
above 255 long.
This commit is contained in:
Nick Craig-Wood 2020-01-19 14:54:55 +00:00
parent baaec5b126
commit 31f21551bf
2 changed files with 2 additions and 2 deletions

View File

@ -108,7 +108,7 @@ func (d *Dir) ReadDirAll(ctx context.Context) (dirents []fuse.Dirent, err error)
}
for _, node := range items {
name := node.Name()
if len(name) >= mountlib.MaxLeafSize {
if len(name) > mountlib.MaxLeafSize {
fs.Errorf(d, "Name too long (%d bytes) for FUSE, skipping: %s", len(name), name)
continue
}

View File

@ -48,7 +48,7 @@ type (
// Global constants
const (
MaxLeafSize = 4095 // don't pass file names longer than this
MaxLeafSize = 1024 // don't pass file names longer than this
)
func init() {