diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2007-12-16 19:56:04 +0100 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2007-12-16 19:56:04 +0100 |
commit | 2bb4dd9766479348a2829ceb8ef583a788bfd840 (patch) | |
tree | 25db8dc4c357ee6c200dd9f4095d6898ceb41396 /extras/volume_id/lib/volume_id.c | |
parent | 5caa40bea22b9ac07dbe667985d1b8556d8b6b80 (diff) |
volume_id: run only once into a timeout for unreadable devices
Diffstat (limited to 'extras/volume_id/lib/volume_id.c')
-rw-r--r-- | extras/volume_id/lib/volume_id.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/extras/volume_id/lib/volume_id.c b/extras/volume_id/lib/volume_id.c index 59303d5bff..b82de2344d 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); |