From: liminghao Date: Mon, 10 Apr 2017 01:48:51 +0000 (+0800) Subject: AOSP: blkid: Resolve to the exFAT uuid change on reboot. X-Git-Tag: v1.43.5~34 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=2971e14beafea43d9428de2ffe98f8f42f4eb24e;p=tools%2Fe2fsprogs.git AOSP: blkid: Resolve to the exFAT uuid change on reboot. The volume_serial into exFAT super block is uuid but not standard uuid, it's just volume serial number. Change-Id: I376ed9fe1ba1b7f3d367d78cc5e2bb8ea9cc2d13 Signed-off-by: liminghao From AOSP commit: 91e756e829362c66265334e2e20fb3604586ce8b Signed-off-by: Theodore Ts'o --- diff --git a/lib/blkid/probe.c b/lib/blkid/probe.c index fae74a7..3bcf4c3 100644 --- a/lib/blkid/probe.c +++ b/lib/blkid/probe.c @@ -1473,6 +1473,7 @@ static int probe_exfat(struct blkid_probe *probe, struct blkid_magic *id, struct exfat_super_block *sb; struct exfat_entry_label *label; uuid_t uuid; + sb = (struct exfat_super_block *)buf; if (!sb || !CLUSTER_SIZE(sb)) { DBG(DEBUG_PROBE, printf("bad exfat superblock.\n")); @@ -1486,11 +1487,11 @@ static int probe_exfat(struct blkid_probe *probe, struct blkid_magic *id, blkid_set_tag(probe->dev, "LABEL", "disk", 4); } + memset(uuid, 0, sizeof (uuid)); snprintf(uuid, sizeof (uuid), "%02hhX%02hhX-%02hhX%02hhX", sb->volume_serial[3], sb->volume_serial[2], sb->volume_serial[1], sb->volume_serial[0]); - - set_uuid(probe->dev, uuid, 0); + blkid_set_tag(probe->dev, "UUID", uuid, strlen(uuid)); return 0; }