From: Martin Kletzander Date: Fri, 10 Jul 2020 13:13:56 +0000 (+0200) Subject: resctrl: Use exclusive lock for /sys/fs/resctrl X-Git-Tag: v6.7.0-rc1~246 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa44bc8fd074d00d5cc7fe16f31da40487ee2804;p=thirdparty%2Flibvirt.git resctrl: Use exclusive lock for /sys/fs/resctrl That's the way it should've been all the time. It was originally the case, but then the rework to virFileFlock() made the function ambiguous when it was created in commit 5a0a5f7fb5f5, and due to that it was misused in commit 657ddeff2313 and since then the lock being taken was shared rather than exclusive. Signed-off-by: Martin Kletzander Reviewed-by: Andrea Bolognani Reviewed-by: Ján Tomko --- diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index 3563fc560d..9b78a6cb15 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -463,7 +463,7 @@ virResctrlLockWrite(void) return -1; } - if (virFileFlock(fd, true, true) < 0) { + if (virFileFlock(fd, true, false) < 0) { virReportSystemError(errno, "%s", _("Cannot lock resctrl")); VIR_FORCE_CLOSE(fd); return -1;