X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=extras%2Fvolume_id%2Flib%2Fvolume_id.c;h=b82de2344de33cb6624e993577cb009b0462dc1f;hb=2bb4dd9766479348a2829ceb8ef583a788bfd840;hp=59303d5bffce2f2e8228f33980bf7a385151d3ee;hpb=b10941c08db89f52038e19ee8a29f26d7808a448;p=elogind.git diff --git a/extras/volume_id/lib/volume_id.c b/extras/volume_id/lib/volume_id.c index 59303d5bf..b82de2344 100644 --- a/extras/volume_id/lib/volume_id.c +++ b/extras/volume_id/lib/volume_id.c @@ -347,6 +347,10 @@ int volume_id_probe_raid(struct volume_id *id, uint64_t off, uint64_t size) if (id == NULL) return -EINVAL; + /* run only once into a timeout for unreadable devices */ + if (volume_id_get_buffer(id, 0x00, 0x200) == NULL) + return -1; + info("probing at offset 0x%llx, size 0x%llx", (unsigned long long) off, (unsigned long long) size); @@ -378,6 +382,10 @@ int volume_id_probe_filesystem(struct volume_id *id, uint64_t off, uint64_t size if (id == NULL) return -EINVAL; + /* run only once into a timeout for unreadable devices */ + if (volume_id_get_buffer(id, 0x00, 0x200) == NULL) + return -1; + info("probing at offset 0x%llx, size 0x%llx", (unsigned long long) off, (unsigned long long) size);