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 5a0a5f7fb5, and due to that it was misused in commit
657ddeff23 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>
This commit is contained in:
Martin Kletzander 2020-07-10 15:13:56 +02:00
parent e648616a6a
commit fa44bc8fd0

View 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;