From 75ebdeb9e0064bb268c6def4cd8049aa9d18742c Mon Sep 17 00:00:00 2001 From: Tomohiro Kusumi Date: Mon, 12 Aug 2019 01:01:55 +0900 Subject: [PATCH] sbin/hammer2: Don't test uuid on "info"/"mountall" if uuid is 0 Don't terminate if HAMMER2 device/partition has 0 uuid. --- sbin/hammer2/cmd_info.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sbin/hammer2/cmd_info.c b/sbin/hammer2/cmd_info.c index fbca749404..8108e8df1a 100644 --- a/sbin/hammer2/cmd_info.c +++ b/sbin/hammer2/cmd_info.c @@ -226,10 +226,11 @@ h2disk_check(const char *devpath, if (partinfo.fstype != FS_HAMMER2) { uint32_t status; uuid_t h2uuid; + int is_nil = uuid_is_nil(&partinfo.fstype_uuid, NULL); uuid_from_string(HAMMER2_UUID_STRING, &h2uuid, &status); - if (status != uuid_s_ok || - uuid_compare(&partinfo.fstype_uuid, &h2uuid, NULL) != 0) { + if (!is_nil && (status != uuid_s_ok || + uuid_compare(&partinfo.fstype_uuid, &h2uuid, NULL) != 0)) { goto done; } } -- 2.41.0