From nobody Sun Feb 8 12:19:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) client-ip=216.205.24.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1596023030; cv=none; d=zohomail.com; s=zohoarc; b=EAa5FRMj1FlvCRBSGtGka41VonUWMnAf26a00dHzkOVZUzavIMASGdufFgEjfvTz3u+HJQTkaCBKKJg83oNdY8Dk6RZo0j5ACOSYLB52tWiV6gCUUF/FwuAQTDiM1v9Gxzk6/4VPAjjUFZsUkslz9s15OaJz2hSro3u4XVoz4ew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596023030; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gmrYUoXGbJLWuW8yxLJxsZuUFfA+4jDjEdkxe+W72zY=; b=KUS6Re1/4NO445sBm1HURFLJMm9435+kDG7+AeeHwhJwGevAXkBAJP/33Ip2kbIXX/doxtHDUy3lpb3UURAnqQUGFuVP7BJTL0DQo+I8Qe+Ip4fXQsAQqw8dAUVIcWA42YlssqYzl03llQcqqaD3MVPjZSJXlA4eL6KsXOhXCnQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by mx.zohomail.com with SMTPS id 15960230302866.5932320581680415; Wed, 29 Jul 2020 04:43:50 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-449-C548SQ0hP5yvLGPrJHhEwQ-1; Wed, 29 Jul 2020 07:43:47 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9DE2980BCA2; Wed, 29 Jul 2020 11:43:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7B37F70110; Wed, 29 Jul 2020 11:43:41 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4B1A81809563; Wed, 29 Jul 2020 11:43:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06TBhTKh002547 for ; Wed, 29 Jul 2020 07:43:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id D3D3E19741; Wed, 29 Jul 2020 11:43:29 +0000 (UTC) Received: from carol.localdomain (unknown [10.40.195.78]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C3E5919C71; Wed, 29 Jul 2020 11:43:26 +0000 (UTC) Received: from carol.redhat.com (carol.k8r.cz [127.0.0.1]) by carol.localdomain (Postfix) with ESMTP id 5312BC20023; Wed, 29 Jul 2020 13:43:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596023029; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=gmrYUoXGbJLWuW8yxLJxsZuUFfA+4jDjEdkxe+W72zY=; b=Dw+yeofcFmVJaaebapHQU0tG1mEy6XYyExkd7cofgvI4CSL1mVHjernG8vO3AqOPE/s6W2 DVHN/0tvtDfUlOuEP662QAIXaZqemKlzUsWi8PkzlyMd2srgRVhKmAmJhxlx4+lvlb7xp+ rr3uWL0IM5sV4Oqlw4SdWyD+j1ypkTI= X-MC-Unique: C548SQ0hP5yvLGPrJHhEwQ-1 From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH v3 1/3 (for 6.6.0)] resctrl: Use exclusive lock for /sys/fs/resctrl Date: Wed, 29 Jul 2020 13:43:12 +0200 Message-Id: <41a2fa9bcc8babf19a663dcdde2ad040063f7972.1596021883.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Andrea Bolognani X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" 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 --- src/util/virresctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index 3563fc560db5..9b78a6cb159b 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -463,7 +463,7 @@ virResctrlLockWrite(void) return -1; } =20 - if (virFileFlock(fd, true, true) < 0) { + if (virFileFlock(fd, true, false) < 0) { virReportSystemError(errno, "%s", _("Cannot lock resctrl")); VIR_FORCE_CLOSE(fd); return -1; --=20 2.28.0