sbin/hammer2: Don't test uuid on "info"/"mountall" if uuid is 0
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 11 Aug 2019 16:01:55 +0000 (01:01 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 11 Aug 2019 16:24:22 +0000 (01:24 +0900)
Don't terminate if HAMMER2 device/partition has 0 uuid.

sbin/hammer2/cmd_info.c

index fbca749..8108e8d 100644 (file)
@@ -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;
                }
        }