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.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user