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)
|
return nil, fuse.ToStatus(err)
|
||||||
}
|
}
|
||||||
// Create content
|
// 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 {
|
if err != nil {
|
||||||
nametransform.DeleteLongNameAt(dirfd, cName)
|
nametransform.DeleteLongNameAt(dirfd, cName)
|
||||||
return nil, fuse.ToStatus(err)
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Create content, normal (short) file name
|
// Create content, normal (short) file name
|
||||||
fd, err = syscallcompat.OpenatUser(dirfd, cName, newFlags|syscall.O_CREAT|syscall.O_EXCL, mode, context)
|
fd, err = syscallcompat.OpenatUser(dirfd, cName, newFlags|syscall.O_CREAT|syscall.O_EXCL, mode, context)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// xfstests generic/488 triggers this
|
// xfstests generic/488 triggers this
|
||||||
if err == syscall.EMFILE {
|
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)
|
return nil, fuse.ToStatus(err)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
f := os.NewFile(uintptr(fd), cName)
|
f := os.NewFile(uintptr(fd), cName)
|
||||||
return NewFile(f, fs)
|
return NewFile(f, fs)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue