diff options
author | Karel Zak | 2017-06-21 11:54:51 +0200 |
---|---|---|
committer | Karel Zak | 2017-06-21 11:54:51 +0200 |
commit | 258e74626d19863d41818eff753215ff052be37b (patch) | |
tree | 8e920ab7f3f82fa0bb86b61636529e122e3355f7 | |
parent | travis: use --disable-makeinstall-chown everywhere (diff) | |
parent | tests: Add UDF hdd images with blocksize 1024 and 4096 created by Linux mkudf... (diff) | |
download | kernel-qcow2-util-linux-258e74626d19863d41818eff753215ff052be37b.tar.gz kernel-qcow2-util-linux-258e74626d19863d41818eff753215ff052be37b.tar.xz kernel-qcow2-util-linux-258e74626d19863d41818eff753215ff052be37b.zip |
Merge branch 'master' of https://github.com/pali/util-linux
* 'master' of https://github.com/pali/util-linux:
tests: Add UDF hdd images with blocksize 1024 and 4096 created by Linux mkudffs 1.3
libblkid: udf: Fix detection of UDF images with block size 1024 and 4096
-rw-r--r-- | libblkid/src/superblocks/udf.c | 13 | ||||
-rw-r--r-- | tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-4 | 9 | ||||
-rw-r--r-- | tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-5 | 9 | ||||
-rw-r--r-- | tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-4.img.xz | bin | 0 -> 2380 bytes | |||
-rw-r--r-- | tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-5.img.xz | bin | 0 -> 2396 bytes |
5 files changed, 25 insertions, 6 deletions
diff --git a/libblkid/src/superblocks/udf.c b/libblkid/src/superblocks/udf.c index f908001ad..602cf408e 100644 --- a/libblkid/src/superblocks/udf.c +++ b/libblkid/src/superblocks/udf.c @@ -127,7 +127,7 @@ static int probe_udf(blkid_probe pr, struct volume_descriptor *vd; struct volume_structure_descriptor *vsd; unsigned int bs; - unsigned int pbs[2]; + unsigned int pbs[5]; unsigned int b; unsigned int type; unsigned int count; @@ -141,9 +141,12 @@ static int probe_udf(blkid_probe pr, /* The block size of a UDF filesystem is that of the underlying * storage; we check later on for the special case of image files, - * which may have the 2048-byte block size of optical media. */ + * which may have any block size valid for UDF filesystem */ pbs[0] = blkid_probe_get_sectorsize(pr); - pbs[1] = 0x800; + pbs[1] = 512; + pbs[2] = 1024; + pbs[3] = 2048; + pbs[4] = 4096; /* check for a Volume Structure Descriptor (VSD); each is * 2048 bytes long */ @@ -168,8 +171,6 @@ nsr: sizeof(*vsd)); if (!vsd) return errno ? -errno : 1; - if (vsd->id[0] == '\0') - return 1; if (memcmp(vsd->id, "NSR02", 5) == 0) goto anchor; if (memcmp(vsd->id, "NSR03", 5) == 0) @@ -179,7 +180,7 @@ nsr: anchor: /* read Anchor Volume Descriptor (AVDP), checking block size */ - for (i = 0; i < 2; i++) { + for (i = 0; i < 5; i++) { vd = (struct volume_descriptor *) blkid_probe_get_buffer(pr, 256 * pbs[i], sizeof(*vd)); if (!vd) diff --git a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-4 b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-4 new file mode 100644 index 000000000..a1d0527c8 --- /dev/null +++ b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-4 @@ -0,0 +1,9 @@ +ID_FS_LABEL=Label +ID_FS_LABEL_ENC=Label +ID_FS_LOGICAL_VOLUME_ID=Label +ID_FS_TYPE=udf +ID_FS_USAGE=filesystem +ID_FS_UUID=59418701b1e8322d +ID_FS_UUID_ENC=59418701b1e8322d +ID_FS_VOLUME_ID=Label +ID_FS_VOLUME_SET_ID=59418701b1e8322dLinuxUDF diff --git a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-5 b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-5 new file mode 100644 index 000000000..fcd6cc9bc --- /dev/null +++ b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-5 @@ -0,0 +1,9 @@ +ID_FS_LABEL=Label +ID_FS_LABEL_ENC=Label +ID_FS_LOGICAL_VOLUME_ID=Label +ID_FS_TYPE=udf +ID_FS_USAGE=filesystem +ID_FS_UUID=594186edcc164a70 +ID_FS_UUID_ENC=594186edcc164a70 +ID_FS_VOLUME_ID=Label +ID_FS_VOLUME_SET_ID=594186edcc164a70LinuxUDF diff --git a/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-4.img.xz b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-4.img.xz Binary files differnew file mode 100644 index 000000000..047e39a0d --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-4.img.xz diff --git a/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-5.img.xz b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-5.img.xz Binary files differnew file mode 100644 index 000000000..291d7ebd6 --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-5.img.xz |