summaryrefslogtreecommitdiff
path: root/internal/fusefrontend/fs.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2019-01-04 23:15:04 +0100
committerJakob Unterwurzacher2019-01-04 23:15:04 +0100
commit3473a8496387246e7666ee45c801486d8d70bc4f (patch)
tree4887785d0ed87302ab57cb4c15d680d9daafe7b6 /internal/fusefrontend/fs.go
parenteff35e60b63331e3e10f921792baa10b236a721d (diff)
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.
Diffstat (limited to 'internal/fusefrontend/fs.go')
-rw-r--r--internal/fusefrontend/fs.go6
1 files changed, 6 insertions, 0 deletions
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)
}
}