HomeFreeBSD

zed-functions.sh: zed_lock(): don't truncate lock

Description

zed-functions.sh: zed_lock(): don't truncate lock

By appending instead of truncating, we can lock on any file (with write
permissions) instead of only dedicated lock files, since the locking
process itself no longer alters the file in any way

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12042

Details

Provenance
наб <nabijaczleweli@nabijaczleweli.xyz>Authored on May 14 2021, 2:17 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jun 9 2021, 8:06 PM
Parents
rG2c3d7283b46f: libzfs: On FreeBSD, use MNT_NOWAIT with getfsstat
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGd6a0cecab142: zed-functions.sh: zed_lock(): don't truncate lock (authored by наб <nabijaczleweli@nabijaczleweli.xyz>).Jun 9 2021, 8:06 PM