OSDN Git Service

Tom Marshall reported that blkid was handling ext2 wrong.
authorRob Landley <rob@landley.net>
Fri, 4 Dec 2015 22:17:03 +0000 (16:17 -0600)
committerRob Landley <rob@landley.net>
Fri, 4 Dec 2015 22:17:03 +0000 (16:17 -0600)
Even though ext2 has a comment that it has to be at the start, I added swap
to the start of the array (oops). The test suite was also wrong (it was
matching the _incorrect_ output).

tests/blkid.test
toys/other/blkid.c

index 3f676df..25ba9d1 100755 (executable)
@@ -16,10 +16,10 @@ testing "blkid ext2" 'bzcat "$BDIR"/ext2.bz2 | blkid -' \
   '-: LABEL="myext2" UUID="e59093ba-4135-4fdb-bcc4-f20beae4dfaf" TYPE="ext2"\n' \
   "" "" 
 testing "blkid ext3" 'bzcat "$BDIR"/ext3.bz2 | blkid -' \
-  '-: LABEL="myext3" UUID="79d1c877-1a0f-4e7d-b21d-fc32ae3ef101" TYPE="ext2"\n' \
+  '-: LABEL="myext3" UUID="79d1c877-1a0f-4e7d-b21d-fc32ae3ef101" TYPE="ext3"\n' \
   "" "" 
 testing "blkid ext4" 'bzcat "$BDIR"/ext4.bz2 | blkid -' \
-  '-: LABEL="myext4" UUID="dc4b7c00-c0c0-4600-af7e-0335f09770fa" TYPE="ext2"\n' \
+  '-: LABEL="myext4" UUID="dc4b7c00-c0c0-4600-af7e-0335f09770fa" TYPE="ext4"\n' \
   "" ""
 testing "blkid f2fs" 'bzcat "$BDIR"/f2fs.bz2 | blkid -' \
   '-: LABEL="" UUID="b53d3619-c204-4c0b-8504-36363578491c" TYPE="f2fs"\n' \
index 8d3e770..4883b60 100644 (file)
@@ -34,8 +34,8 @@ struct fstype {
 };
 
 static const struct fstype fstypes[] = {
-  {"swap", 0x4341505350415753LL, 8, 4086, 1036, 15, 1052},
   {"ext2", 0xEF53, 2, 1080, 1128, 16, 1144}, // keep this first for ext3/4 check
+  {"swap", 0x4341505350415753LL, 8, 4086, 1036, 15, 1052},
   // NTFS label actually 8/16 0x4d80 but horrible: 16 bit wide characters via
   // codepage, something called a uuid that's only 8 bytes long...
   {"ntfs", 0x5346544e, 4, 3, 0x48+(8<<24), 0, 0},