diff options
author | Jakob Unterwurzacher | 2023-06-19 13:35:29 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2024-12-04 19:53:15 +0100 |
commit | 4645bfae7e5c79556ef25c11ec8f0aef0fb679f4 (patch) | |
tree | bb67afd4769661deafe92ad854415a48de0e9ea5 | |
parent | bc0879fd2da2a7897ffc2f74251dd9814d600528 (diff) |
fusefrontend: sharedstorage: add warnings for lock failureLockSharedStorage_rebase1
Complain loudly when the underlying storage does not support
byte-range locks.
https://github.com/rfjakob/gocryptfs/issues/754
-rw-r--r-- | internal/fusefrontend/file.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go index 6def7b0..d8237b4 100644 --- a/internal/fusefrontend/file.go +++ b/internal/fusefrontend/file.go @@ -262,6 +262,7 @@ func (f *File) Read(ctx context.Context, buf []byte, off int64) (resultData fuse blocks := f.contentEnc.ExplodePlainRange(uint64(off), uint64(len(buf))) alignedOffset, alignedLength := blocks[0].JointCiphertextRange(blocks) if err := f.LockSharedStorage(unix.F_RDLCK, int64(alignedOffset), int64(alignedLength)); err != nil { + tlog.Warn.Printf("ino%d: FUSE Read: LockSharedStorage(F_RDLCK, %d, %d) failed: %v", f.qIno.Ino, alignedOffset, alignedLength, err) return nil, fs.ToErrno(err) } out, errno = f.doRead(buf[:0], uint64(off), uint64(len(buf))) @@ -290,7 +291,7 @@ func (f *File) doWrite(data []byte, off int64) (uint32, syscall.Errno) { // If the file ID is not cached, read it from disk if f.fileTableEntry.ID == nil { if err := f.LockSharedStorage(unix.F_WRLCK, 0, contentenc.HeaderLen); err != nil { - tlog.Warn.Printf("ino%d: LockSharedStorage(F_WRLCK, %d, %d)failed: %v", 0, f.qIno.Ino, contentenc.HeaderLen, err) + tlog.Warn.Printf("ino%d: doWrite: LockSharedStorage(F_WRLCK, %d, %d) failed: %v", f.qIno.Ino, 0, contentenc.HeaderLen, err) return 0, fs.ToErrno(err) } var err error |