fusefrontend: Print 'too many open files' warning for both short and long names.
While we're at it, also replace os.* constants with syscall.* constants.
This commit is contained in:
parent
d8bb223dd3
commit
8f33145651
|
@ -254,14 +254,14 @@ func (fs *FS) Create(path string, flags uint32, mode uint32, context *fuse.Conte
|
|||
return nil, fuse.ToStatus(err)
|
||||
}
|
||||
// Create content
|
||||
fd, err = syscallcompat.OpenatUser(dirfd, cName, newFlags|os.O_CREATE|os.O_EXCL, mode, context)
|
||||
fd, err = syscallcompat.OpenatUser(dirfd, cName, newFlags|syscall.O_CREAT|syscall.O_EXCL, mode, context)
|
||||
if err != nil {
|
||||
nametransform.DeleteLongNameAt(dirfd, cName)
|
||||
return nil, fuse.ToStatus(err)
|
||||
}
|
||||
} else {
|
||||
// Create content, normal (short) file name
|
||||
fd, err = syscallcompat.OpenatUser(dirfd, cName, newFlags|syscall.O_CREAT|syscall.O_EXCL, mode, context)
|
||||
}
|
||||
if err != nil {
|
||||
// xfstests generic/488 triggers this
|
||||
if err == syscall.EMFILE {
|
||||
|
@ -271,7 +271,6 @@ func (fs *FS) Create(path string, flags uint32, mode uint32, context *fuse.Conte
|
|||
}
|
||||
return nil, fuse.ToStatus(err)
|
||||
}
|
||||
}
|
||||
f := os.NewFile(uintptr(fd), cName)
|
||||
return NewFile(f, fs)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue