diff options
author | Jakob Unterwurzacher | 2018-04-02 18:32:30 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2018-04-02 18:32:30 +0200 |
commit | b6c8960b01f9e5366814b0dada57a0b1e6a031d9 (patch) | |
tree | 6a65255c30c7bcd086523fd4e0970d3b59b230de /internal/fusefrontend/fs_dir.go | |
parent | e6caf56ea4ab10e747aa5dfc0a768cb8176ebe6a (diff) |
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.
Diffstat (limited to 'internal/fusefrontend/fs_dir.go')
-rw-r--r-- | internal/fusefrontend/fs_dir.go | 13 |
1 files changed, 7 insertions, 6 deletions
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() |