summaryrefslogtreecommitdiff
path: root/internal/fusefrontend
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-10-28 20:07:59 +0200
committerJakob Unterwurzacher2016-10-28 21:18:36 +0200
commit85f1fd0b0f16ea47e038584e7ff53894d508604a (patch)
treec9bb4bf9441312eb031fc168a6e0c4613e8da3fa /internal/fusefrontend
parent012152f3d1f111541f2fbb4c1e65c91243cd6bde (diff)
fusefronted: more concise corrupt block log message
Calculating the block offset is easy enough, even more now that gocryptfs-xray exists.
Diffstat (limited to 'internal/fusefrontend')
-rw-r--r--internal/fusefrontend/file.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go
index 9991f3e..b192b99 100644
--- a/internal/fusefrontend/file.go
+++ b/internal/fusefrontend/file.go
@@ -169,10 +169,7 @@ func (f *file) doRead(off uint64, length uint64) ([]byte, fuse.Status) {
plaintext, err := f.contentEnc.DecryptBlocks(ciphertext, firstBlockNo, f.header.ID)
if err != nil {
curruptBlockNo := firstBlockNo + f.contentEnc.PlainOffToBlockNo(uint64(len(plaintext)))
- cipherOff := f.contentEnc.BlockNoToCipherOff(curruptBlockNo)
- plainOff := f.contentEnc.BlockNoToPlainOff(curruptBlockNo)
- tlog.Warn.Printf("ino%d: doRead: corrupt block #%d (plainOff=%d, cipherOff=%d)",
- f.ino, curruptBlockNo, plainOff, cipherOff)
+ tlog.Warn.Printf("ino%d: doRead: corrupt block #%d: %v", f.ino, curruptBlockNo, err)
return nil, fuse.EIO
}
@@ -205,7 +202,7 @@ func (f *file) Read(buf []byte, off int64) (resultData fuse.ReadResult, code fus
out, status := f.doRead(uint64(off), uint64(len(buf)))
if status == fuse.EIO {
- tlog.Warn.Printf("ino%d: Read failed with EIO, offset=%d, length=%d", f.ino, len(buf), off)
+ tlog.Warn.Printf("ino%d: Read: returning EIO, offset=%d, length=%d", f.ino, len(buf), off)
}
if status != fuse.OK {
return nil, status