From 95b93db35f451dbaef49ae53c9b69e32dc10e14a Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 14 Jul 2018 15:18:27 +0200 Subject: [PATCH] fusefrontend: log prealloc failures at Info level If the underlying filesystem is full, it is normal get ENOSPC here. Log at Info level instead of Warning. Fixes xfstests generic/015 and generic/027, which complained about the extra output. --- internal/fusefrontend/file.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go index b056dc2..bad9bfc 100644 --- a/internal/fusefrontend/file.go +++ b/internal/fusefrontend/file.go @@ -122,7 +122,9 @@ func (f *File) createHeader() (fileID []byte, err error) { if !f.fs.args.NoPrealloc { err = syscallcompat.EnospcPrealloc(int(f.fd.Fd()), 0, contentenc.HeaderLen) if err != nil { - tlog.Warn.Printf("ino%d: createHeader: prealloc failed: %s\n", f.qIno.Ino, err.Error()) + // If the underlying filesystem is full, it is normal get ENOSPC here. + // Log at Info level instead of Warning. + tlog.Info.Printf("ino%d: createHeader: prealloc failed: %s\n", f.qIno.Ino, err.Error()) return nil, err } } @@ -317,7 +319,9 @@ func (f *File) doWrite(data []byte, off int64) (uint32, fuse.Status) { if !f.fs.args.NoPrealloc { err = syscallcompat.EnospcPrealloc(int(f.fd.Fd()), cOff, int64(len(ciphertext))) if err != nil { - tlog.Warn.Printf("ino%d fh%d: doWrite: prealloc failed: %s", f.qIno.Ino, f.intFd(), err.Error()) + // If the underlying filesystem is full, it is normal get ENOSPC here. + // Log at Info level instead of Warning. + tlog.Info.Printf("ino%d fh%d: doWrite: prealloc failed: %s", f.qIno.Ino, f.intFd(), err.Error()) return 0, fuse.ToStatus(err) } }