From 8f76d1ea0a63f546ad09fa70be1ed7b6a7d29fe6 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Fri, 2 Jun 2023 14:24:44 +0200 Subject: fusefrontend: sharedstorage: use byte-range lock on file header creation Multiple host writing to the same empty file at the same time could have overwritten each other's newly created file header, leading to data corruption. Fix the race by placing a byte-range lock on the file when creating the file header. --- internal/syscallcompat/sys_linux.go | 1 + 1 file changed, 1 insertion(+) (limited to 'internal/syscallcompat/sys_linux.go') diff --git a/internal/syscallcompat/sys_linux.go b/internal/syscallcompat/sys_linux.go index a64b27e..3714b75 100644 --- a/internal/syscallcompat/sys_linux.go +++ b/internal/syscallcompat/sys_linux.go @@ -32,6 +32,7 @@ const ( RENAME_NOREPLACE = unix.RENAME_NOREPLACE RENAME_WHITEOUT = unix.RENAME_WHITEOUT RENAME_EXCHANGE = unix.RENAME_EXCHANGE + F_OFD_SETLKW = unix.F_OFD_SETLKW ) var preallocWarn sync.Once -- cgit v1.2.3