tools/oxenstored: mkdir conflicts were sometimes missed
authorEdwin Török <edvin.torok@citrix.com>
Fri, 15 Jan 2021 19:38:58 +0000 (19:38 +0000)
committerIan Jackson <iwj@xenproject.org>
Fri, 19 Mar 2021 13:43:44 +0000 (13:43 +0000)
commit048af4453c2cfaf63ff5a1abd811fc7625c20c3c
tree7a5c305155943d82438d48e5b1ad28b2b41506ec
parentd5ed41d3b01e314a64ccaf4f4540a3bc502f4979
tools/oxenstored: mkdir conflicts were sometimes missed

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@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
(cherry picked from commit 45dee7d92b493bb531e7e77a6f9c0180ab152f87)
tools/ocaml/xenstored/transaction.ml