diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-11-30 12:09:36 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-11-30 20:46:30 +0100 |
commit | 7cc84b2cd385b8a838347c2ff29c978689dadf84 (patch) | |
tree | 468ffefa68d83ca03d2f79f7406fd919b88eb5c9 /src/partition | |
parent | 7f2806d50937a7fbe6d673ce8fc62634129c3a12 (diff) | |
download | systemd-7cc84b2cd385b8a838347c2ff29c978689dadf84.tar.gz |
dissect-image: return error if results are ambiguous
We let the caller make the decision. Existing callers are OK with treating an
ambiguous result the same as no content, but makefs and growfs should refuse such
partitions.
Diffstat (limited to 'src/partition')
-rw-r--r-- | src/partition/growfs.c | 2 | ||||
-rw-r--r-- | src/partition/makefs.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/partition/growfs.c b/src/partition/growfs.c index f9c604ca6f..8b44c1ded7 100644 --- a/src/partition/growfs.c +++ b/src/partition/growfs.c @@ -151,6 +151,8 @@ static int maybe_resize_slave_device(const char *mountpath, dev_t main_devno) { xsprintf_dev_num_path(devpath, "block", devno); r = probe_filesystem(devpath, &fstype); + if (r == -EUCLEAN) + return log_warning_errno(r, "Cannot reliably determine probe \"%s\", refusing to proceed.", devpath); if (r < 0) return log_warning_errno(r, "Failed to probe \"%s\": %m", devpath); diff --git a/src/partition/makefs.c b/src/partition/makefs.c index c24c6ebcde..e5e125255b 100644 --- a/src/partition/makefs.c +++ b/src/partition/makefs.c @@ -90,7 +90,11 @@ int main(int argc, char *argv[]) { r = probe_filesystem(device, &detected); if (r < 0) { - log_warning_errno(r, "Failed to probe \"%s\": %m", device); + log_warning_errno(r, + r == -EUCLEAN ? + "Cannot reliably determine probe \"%s\", refusing to proceed." : + "Failed to probe \"%s\": %m", + device); goto finish; } |