Files
cryptsetup/tests
Luca Boccassi f6706ce124 Add a test function to exercise concurrent activations
The issue can be reproduced very easily by starting 2 veritysetup processes
at the same time:

$ sudo veritysetup open -v ./img.raw img ./img.verity  & sudo veritysetup open -v ./img.raw img ./img.verity
[1] 814021
device-mapper: create ioctl on img CRYPT-VERITY-cea03b7bc5b94e088e5754ff33be71d6-img failed: Device or resource busy
Verity device detected corruption after activation.
Command successful.
Command failed with code -1 (wrong or missing parameters).

Note how veritysetup open is reporting -EINVAL as the return code.

After the fix:

$ sudo veritysetup open -v ./img.raw img ./img.verity  & sudo veritysetup open -v ./img.raw img ./img.verity
[1] 814649
Verity device detected corruption after activation.
Command successful.
Device img already exists.
Command failed with code -5 (device already exists or device is busy).
2020-08-12 16:51:20 +01:00
..
2019-01-28 08:40:20 -02:00
2020-08-09 11:24:53 +02:00
2020-01-03 13:04:55 +01:00
2017-09-24 19:50:17 +02:00
2020-01-03 13:04:55 +01:00
2020-08-09 11:31:27 +02:00
2019-07-12 15:37:18 +02:00
2020-01-03 13:04:55 +01:00
2020-01-03 13:04:55 +01:00
2017-08-26 11:46:26 +02:00