X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fosd-zfs%2Fosd_scrub.c;h=8758ebd8cd6e4ab645dc4e135d4a6772b432538f;hp=d3c3e900eef522ac24a2cf32c3f35abdb2ecd664;hb=90fd0cd449b9ae3fbff5a99e0edcf288799037c0;hpb=077570483e75e0610fd45149b926097547c434b8 diff --git a/lustre/osd-zfs/osd_scrub.c b/lustre/osd-zfs/osd_scrub.c index d3c3e90..8758ebd 100644 --- a/lustre/osd-zfs/osd_scrub.c +++ b/lustre/osd-zfs/osd_scrub.c @@ -1417,7 +1417,7 @@ int osd_scrub_setup(const struct lu_env *env, struct osd_device *dev) bool dirty = false; ENTRY; - memcpy(dev->od_uuid, + memcpy(dev->od_uuid.b, &dsl_dataset_phys(dev->od_os->os_dsl_dataset)->ds_guid, sizeof(dsl_dataset_phys(dev->od_os->os_dsl_dataset)->ds_guid)); memset(&dev->od_scrub, 0, sizeof(struct lustre_scrub)); @@ -1457,29 +1457,12 @@ int osd_scrub_setup(const struct lu_env *env, struct osd_device *dev) } else if (rc < 0) { GOTO(cleanup_obj, rc); } else { - if (memcmp(sf->sf_uuid, dev->od_uuid, 16) != 0) { - struct obd_uuid *old_uuid; - struct obd_uuid *new_uuid; - - OBD_ALLOC_PTR(old_uuid); - OBD_ALLOC_PTR(new_uuid); - if (!old_uuid || !new_uuid) { - CERROR("%s: UUID has been changed, but" - "failed to allocate RAM for report\n", - osd_name(dev)); - } else { - class_uuid_unparse(sf->sf_uuid, old_uuid); - class_uuid_unparse(dev->od_uuid, new_uuid); - CDEBUG(D_LFSCK, "%s: UUID has been changed " - "from %s to %s\n", osd_name(dev), - old_uuid->uuid, new_uuid->uuid); - } + if (!uuid_equal(&sf->sf_uuid, &dev->od_uuid)) { + CDEBUG(D_LFSCK, + "%s: UUID has been changed from %pU to %pU\n", + osd_name(dev), &sf->sf_uuid, &dev->od_uuid); scrub_file_reset(scrub, dev->od_uuid, SF_INCONSISTENT); dirty = true; - if (old_uuid) - OBD_FREE_PTR(old_uuid); - if (new_uuid) - OBD_FREE_PTR(new_uuid); } else if (sf->sf_status == SS_SCANNING) { sf->sf_status = SS_CRASHED; dirty = true;