From a36429971ad46af5b29d3dafba1adc596e5aaa60 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 20 Jul 2021 15:26:56 +0100 Subject: dissect: use DISKSEQ when waiting for block devices DISKSEQ is a reliable way to find out if we missed a uevent or not, as it's monotonically increasing. If we parse an event with a smaller or no sequence number, we know we need to wait longer. If we parse an event with a greater sequence number, we know we missed it and the device was reused. --- src/gpt-auto-generator/gpt-auto-generator.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gpt-auto-generator') diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c index f5346f49ad..4d0364fcee 100644 --- a/src/gpt-auto-generator/gpt-auto-generator.c +++ b/src/gpt-auto-generator/gpt-auto-generator.c @@ -699,6 +699,7 @@ static int enumerate_partitions(dev_t devnum) { r = dissect_image( fd, NULL, NULL, + /* diskseq= */ 0, UINT64_MAX, USEC_INFINITY, DISSECT_IMAGE_GPT_ONLY| -- cgit v1.2.1