From 3473a8496387246e7666ee45c801486d8d70bc4f Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Fri, 4 Jan 2019 23:15:04 +0100 Subject: [PATCH] fusefrontend: print warning when Create() runs out of file descriptors We alread have this warning in Open(), but xfstests generic/488 causes "too many open files" via Create. Add the same message so the user sees what is going on. --- internal/fusefrontend/fs.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/fusefrontend/fs.go b/internal/fusefrontend/fs.go index af97333..f35fafd 100644 --- a/internal/fusefrontend/fs.go +++ b/internal/fusefrontend/fs.go @@ -255,6 +255,12 @@ func (fs *FS) Create(path string, flags uint32, mode uint32, context *fuse.Conte // Create content, normal (short) file name fd, err = syscallcompat.Openat(dirfd, cName, newFlags|syscall.O_CREAT|syscall.O_EXCL, mode) if err != nil { + // xfstests generic/488 triggers this + if err == syscall.EMFILE { + var lim syscall.Rlimit + syscall.Getrlimit(syscall.RLIMIT_NOFILE, &lim) + tlog.Warn.Printf("Create %q: too many open files. Current \"ulimit -n\": %d", cName, lim.Cur) + } return nil, fuse.ToStatus(err) } }