fusefrontend: log missing gocryptfs.diriv

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.
This commit is contained in:
Jakob Unterwurzacher 2016-10-16 13:43:19 +02:00
parent 57e8df990c
commit 35219d0022
1 changed files with 5 additions and 0 deletions

View File

@ -255,6 +255,11 @@ func (fs *FS) OpenDir(dirName string, context *fuse.Context) ([]fuse.DirEntry, f
cDirAbsPath = filepath.Join(fs.args.Cipherdir, cDirName)
cachedIV, err = nametransform.ReadDirIV(cDirAbsPath)
if err != nil {
// 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)
}
}