From 458a2f85e8ae08c534bf8d030fbeeb791893422b Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 11 Aug 2015 18:22:59 +0200 Subject: [PATCH] gpt-auto-generator: warn on ambiguous blkid probe --- src/gpt-auto-generator/gpt-auto-generator.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c index bfcdbc5..0a34f86 100644 --- a/src/gpt-auto-generator/gpt-auto-generator.c +++ b/src/gpt-auto-generator/gpt-auto-generator.c @@ -618,9 +618,12 @@ static int enumerate_partitions(dev_t devnum) { errno = 0; r = blkid_do_safeprobe(b); - if (r == -2 || r == 1) /* no result or uncertain */ + if (r == 1) + return 0; /* no results */ + else if (r == -2) { + log_warning("%s: probe gave ambiguous results, ignoring", node); return 0; - else if (r != 0) + } else if (r != 0) return log_error_errno(errno ?: EIO, "%s: failed to probe: %m", node); errno = 0; -- 2.7.4