diff --git a/src/repart/repart-list-candidate-devices.c b/src/repart/repart-list-candidate-devices.c index f4f5a8aa2c..e11e61d900 100644 --- a/src/repart/repart-list-candidate-devices.c +++ b/src/repart/repart-list-candidate-devices.c @@ -161,8 +161,9 @@ int vl_method_list_candidate_devices( BLOCKDEV_LIST_SHOW_SYMLINKS| BLOCKDEV_LIST_REQUIRE_PARTITION_SCANNING| BLOCKDEV_LIST_IGNORE_ZRAM| - BLOCKDEV_LIST_METADATA| BLOCKDEV_LIST_IGNORE_READ_ONLY| + BLOCKDEV_LIST_METADATA| + BLOCKDEV_LIST_DISKSEQ| (p.ignore_empty ? BLOCKDEV_LIST_IGNORE_EMPTY : 0)| (p.ignore_root ? BLOCKDEV_LIST_IGNORE_ROOT : 0); diff --git a/src/shared/blockdev-list.c b/src/shared/blockdev-list.c index f6b70babfc..1a92b0dea7 100644 --- a/src/shared/blockdev-list.c +++ b/src/shared/blockdev-list.c @@ -279,9 +279,11 @@ int blockdev_list_one( } uint64_t diskseq = UINT64_MAX; - r = sd_device_get_diskseq(dev, &diskseq); - if (r < 0) - log_device_debug_errno(dev, r, "Failed to acquire diskseq of device '%s', ignoring: %m", node); + if (FLAGS_SET(flags, BLOCKDEV_LIST_DISKSEQ)) { + r = sd_device_get_diskseq(dev, &diskseq); + if (r < 0) + log_device_debug_errno(dev, r, "Failed to acquire diskseq of device '%s', ignoring: %m", node); + } _cleanup_free_ char *m = strdup(node); if (!m) diff --git a/src/shared/blockdev-list.h b/src/shared/blockdev-list.h index 3d0c17954a..6a2f350a2e 100644 --- a/src/shared/blockdev-list.h +++ b/src/shared/blockdev-list.h @@ -14,6 +14,7 @@ typedef enum BlockDevListFlags { BLOCKDEV_LIST_IGNORE_READ_ONLY = 1 << 7, /* Ignore read-only block devices */ BLOCKDEV_LIST_REQUIRE_LUKS = 1 << 8, /* Only consider block devices with LUKS superblocks */ BLOCKDEV_LIST_METADATA = 1 << 9, /* Fill in model, vendor, subsystem, read_only */ + BLOCKDEV_LIST_DISKSEQ = 1 << 10, /* Fill in the diskseq field */ } BlockDevListFlags; /* The "dynamic" filters – ones the kernel can flip at runtime via sysattrs on a live device.