[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/3] tools/oxenstored: mkdir conflicts were sometimes missed
- To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Christian Lindig <christian.lindig@xxxxxxxxxx>
- Date: Thu, 4 Feb 2021 10:52:13 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dnYF5xPRmcA32qmT+a3lNmLeTEAOuYmt9qGvzr5Q8ss=; b=L2V9STWyYb2zVff5heyZ2ZC+Fyl1bk5HlZJtc/cUrYDeU8nXBup/28CUqHbYYDec8mMBu7YzQPEqYuVIZ0ZNRTdj0b+G5P6del9tNctPmHNkN3Dp2Ac83BGiOSuN1L587gvNrdzMALSdPglQOFcVo3+XxRZBjYD3P2Rav145S+QcIO9z2mT4W4Q4vFCFxlpp2B/H1Mzm4sy3JVwsEAlXNrDdbTNTMEj8SIWNLZmv/FVOnw3OXinIyzwLQSfGGA79jhWGjGICN+y+IYeHaqlHBk9WscFj18Q+iEldA/c+LG4KsZg8rEfahxPIB1ZQT72S2aPtVGIXGuauHFqmAVOeJQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FUOTa+jodZ4nkioSn9m9ooZHzzdR8d4ooTnwPNwIIfWcCXPQODp3gRXh5zZ8d0Lj0Z0NJcUOmC+HB72uhjHx0DtDZkQDXSr6mYDt9LX15FdRsnR8/o4J3Gjw7SV7pptT8gGjiml0O7mZYairLX9XgCjp+xmvqadiEvWP7McypXrpbHRspPNdNpXLUC9ZWdPsteBHlxrIe8MklFkE+PXrGx5RvRvAiVBprzC9bvtYUy5QE99kIb0F+z9nG2mybmdsOMGpswmSS1lcOVUUBSKrxH62vZa91Gd67iPiItEFbuuSkM1eFQtn4EEBzXAbs7SPDurrJIbNd4T0TGQk17gKeQ==
- Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: Edwin Torok <edvin.torok@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Thu, 04 Feb 2021 10:52:28 +0000
- Ironport-sdr: z8kux/NTAjLe3PbkGtlgiZpHKHsQnmzUYSocFiR2sqeaFd42IAgBV0mnPvu3tQwtijhfpiBw7/ zes75GM8pC9k86PGqewIWn5Z6ZoCJo/gSd7m6kgHzq7qixhU/WoBm0CfvsuAjlsr0KXMpOH15k 9EzyaiEuXNDh+oxJAEngNdDLguIcKnwVph/B/bE4o0U9D1pyRhLz+I2VAE4EuF4YYXDLIZGDvW 98bshymUiJA1k9pw7RJvk7woPqaiduGPQu4RNTXXjshG4v79vFc5p5w/OHMvOw43Ms/n4U+Xp2 BOU=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHW+lMOM4p+9lOZ8UOKE5A9Zry5AKpH0usa
- Thread-topic: [PATCH 3/3] tools/oxenstored: mkdir conflicts were sometimes missed
Acked-by: Christian Lindig <christian.lindig@xxxxxxxxxx>
________________________________________
From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Sent: 03 February 2021 17:35
To: Xen-devel
Cc: Edwin Torok; Christian Lindig; Ian Jackson; Wei Liu
Subject: [PATCH 3/3] tools/oxenstored: mkdir conflicts were sometimes missed
From: Edwin Török <edvin.torok@xxxxxxxxxx>
Due to how set_write_lowpath was used here it didn't detect create/delete
conflicts. When we create an entry we must mark our parent as modified
(this is what creating a new node via write does).
Otherwise we can have 2 transactions one creating, and another deleting a node
both succeeding depending on timing. Or one transaction reading an entry,
concluding it doesn't exist, do some other work based on that information and
successfully commit even if another transaction creates the node via mkdir
meanwhile.
Signed-off-by: Edwin Török <edvin.torok@xxxxxxxxxx>
---
CC: Christian Lindig <christian.lindig@xxxxxxxxxx>
CC: Ian Jackson <iwj@xxxxxxxxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>
---
tools/ocaml/xenstored/transaction.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/ocaml/xenstored/transaction.ml
b/tools/ocaml/xenstored/transaction.ml
index 25bc8c3b4a..17b1bdf2ea 100644
--- a/tools/ocaml/xenstored/transaction.ml
+++ b/tools/ocaml/xenstored/transaction.ml
@@ -165,7 +165,7 @@ let write t perm path value =
let mkdir ?(with_watch=true) t perm path =
Store.mkdir t.store perm path;
- set_write_lowpath t path;
+ set_write_lowpath t (Store.Path.get_parent path);
if with_watch then
add_wop t Xenbus.Xb.Op.Mkdir path
--
2.11.0
|