]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
resctrl: Use exclusive lock for /sys/fs/resctrl
authorMartin Kletzander <mkletzan@redhat.com>
Fri, 10 Jul 2020 13:13:56 +0000 (15:13 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 3 Aug 2020 08:57:47 +0000 (10:57 +0200)
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 <mkletzan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virresctrl.c

index 3563fc560db5edc7ecd6d74b225b6691c5a4950d..9b78a6cb159b951442278cdeccd85e7f6639dd65 100644 (file)
@@ -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;