From b6c8960b01f9e5366814b0dada57a0b1e6a031d9 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Mon, 2 Apr 2018 18:32:30 +0200 Subject: fsck: clean up log output Make sure we get only 1 warning output per problem. Also, add new corruption types to broken_fs_v1.4. --- internal/fusefrontend/fs_dir.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'internal/fusefrontend/fs_dir.go') diff --git a/internal/fusefrontend/fs_dir.go b/internal/fusefrontend/fs_dir.go index fcfdbb5..e13afed 100644 --- a/internal/fusefrontend/fs_dir.go +++ b/internal/fusefrontend/fs_dir.go @@ -286,12 +286,13 @@ func (fs *FS) OpenDir(dirName string, context *fuse.Context) ([]fuse.DirEntry, f cachedIV, err = nametransform.ReadDirIV(cDirAbsPath) if err != nil { fs.dirIVLock.RUnlock() - // This can happen during normal operation when the directory has - // been deleted concurrently. But it can also mean that the - // gocryptfs.diriv is missing due to an error, so log the event - // at "info" level. - tlog.Info.Printf("OpenDir: %v", err) - return nil, fuse.ToStatus(err) + // The directory itself does not exist + if err == syscall.ENOENT { + return nil, fuse.ENOENT + } + // Any other problem warrants an error message + tlog.Warn.Printf("OpenDir %q: could not read gocryptfs.diriv: %v", cDirName, err) + return nil, fuse.EIO } fs.nameTransform.DirIVCache.Store(dirName, cachedIV, cDirName) fs.dirIVLock.RUnlock() -- cgit v1.2.3