aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend
diff options
context:
space:
mode:
authorJakob Unterwurzacher2026-07-16 21:10:14 +0200
committerJakob Unterwurzacher2026-07-16 22:07:54 +0200
commitace4b17c63d8d891227fce33ed36569db9472159 (patch)
tree4810bb425e05f86241557f2890fcdfcea18a17b5 /internal/fusefrontend
parent67e9abeb2830c517cbcbbd93de184055b2d4227b (diff)
fusefrontend: sharedstorage: truncate: error out on failed file lock
Diffstat (limited to 'internal/fusefrontend')
-rw-r--r--internal/fusefrontend/file_allocate_truncate.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/fusefrontend/file_allocate_truncate.go b/internal/fusefrontend/file_allocate_truncate.go
index ad02041..bfd11e1 100644
--- a/internal/fusefrontend/file_allocate_truncate.go
+++ b/internal/fusefrontend/file_allocate_truncate.go
@@ -114,7 +114,10 @@ func (f *File) truncate(newSize uint64) (errno syscall.Errno) {
// Prevent reads and writes concurrent with the truncate operation. It's
// racy on tmpfs and ext4 ( https://lore.kernel.org/all/18e9fa0f-ec31-9107-459c-ae1694503f87@gmail.com/t/ )
// as evident by TestOpenTruncate test failures.
- f.LockSharedStorage(unix.F_WRLCK, 0, 0)
+ err = f.LockSharedStorage(unix.F_WRLCK, 0, 0)
+ if err != nil {
+ return fs.ToErrno(err)
+ }
defer f.UnlockSharedStorage(0, 0)
// With -sharedstorage, we keep the on-disk file header.