Whamcloud - gitweb
blkid: have ntfs's UUID compatible with vol_id
authorPixel <pixel@mandriva.com>
Fri, 11 Jan 2008 10:41:15 +0000 (11:41 +0100)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 14 Jan 2008 15:22:33 +0000 (10:22 -0500)
Ensure the length of the UUID is always the same

without the patch:

% blkid /tmp/a /tmp/b
/tmp/a: UUID="7130E4771519577F" TYPE="ntfs"
/tmp/b: UUID="7E9B4A7CCE99CA" TYPE="ntfs"

with the patch:

% blkid /tmp/a /tmp/b
/tmp/a: UUID="7130E4771519577F" TYPE="ntfs"
/tmp/b: UUID="007E9B4A7CCE99CA" TYPE="ntfs"

ie same as:

% vol_id --uuid /tmp/a ; vol_id --uuid /tmp/b
7130E4771519577F
007E9B4A7CCE99CA

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/blkid/probe.c

index 4c72a56..32d9f3f 100644 (file)
@@ -500,7 +500,7 @@ static int probe_ntfs(struct blkid_probe *probe,
                }
        }
 
-       sprintf(uuid_str, "%llX", blkid_le64(ns->volume_serial));
+       sprintf(uuid_str, "%016llX", blkid_le64(ns->volume_serial));
        blkid_set_tag(probe->dev, "UUID", uuid_str, 0);
        if (label_str[0])
                blkid_set_tag(probe->dev, "LABEL", label_str, 0);