Ubuntu

Merge lp:~jtrigg/ubuntu/raring/util-linux/bug-1164683 into lp:ubuntu/raring/util-linux

Proposed by Jim Trigg on 2013-04-04
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: lp:~jtrigg/ubuntu/raring/util-linux/bug-1164683
Merge into: lp:ubuntu/raring/util-linux
Diff against target: 102 lines (+39/-17) 3 files modified
To merge this branch: bzr merge lp:~jtrigg/ubuntu/raring/util-linux/bug-1164683
Reviewer Review Type Date Requested Status
Dimitri John Ledkov Approve on 2013-07-09
Ubuntu branches 2013-04-04 Pending
Review via email: mp+157226@code.launchpad.net

Description of the Change

Fix bug #1164683 - udf superblock is not parsed correctly by libblkid1 when blocksize < 2048.

Test:
Install udftools and create udf file system with volume id and blocksize < 2048: "sudo mkudffs -b 512 --vid=space /dev/sdb1"
Run blkid on device: "sudo blkid /dev/sdb1"
Without patch, output will be 'TYPE="udf"'. With patch, output will be 'TYPE="udf" LABEL="space"'.
Add /dev/sdb1 to /etc/fstab. Without patch, file system will fail to mount at boot; with patch, file system will mount at boot.
Add LABEL=space to /etc/fstab. Without patch, file system will fail to mount; with patch, file system will mount.

To post a comment you must log in.
Iain Lane (laney) wrote :

Are you seeking to update raring as a stable release update with this patch?

If so, please could you edit the bug with the information requested in https://wiki.ubuntu.com/StableReleaseUpdates#Procedure ?

If not, you can set the status at the top to rejected or similar and it'll fall off the sponsoring queue[0]?

Thanks for your help!

[0] http://reqorts.qa.ubuntu.com/reports/sponsoring/

Dimitri John Ledkov (xnox) wrote :

Uploaded into raring, pending approval for publishing in raring-proposed.

review: Approve

Preview Diff

1=== modified file 'AUTHORS'
2--- AUTHORS 2011-12-16 22:53:42 +0000
3+++ AUTHORS 2013-04-04 20:35:26 +0000
4@@ -282,4 +282,5 @@
5 Yann Droneaud <yann@droneaud.fr>
6 Yoshihiro Takahashi <ytakahashi@miraclelinux.com>
7 Yu Zhiguo <yuzg@cn.fujitsu.com>
8+ Zachary Catlin <z@zc.is>
9 Zdenek Behan <rain@matfyz.cz>
10
11=== modified file 'debian/changelog'
12--- debian/changelog 2013-02-04 15:40:51 +0000
13+++ debian/changelog 2013-04-04 20:35:26 +0000
14@@ -1,3 +1,9 @@
15+util-linux (2.20.1-5.1ubuntu9) UNRELEASED; urgency=low
16+
17+ * Apply upstream patch for udf bug when blocksize < 2048 (LP: #1164683)
18+
19+ -- Jim Trigg (jktrigg) <jtrigg@spamcop.net> Thu, 04 Apr 2013 15:42:05 -0400
20+
21 util-linux (2.20.1-5.1ubuntu8) raring; urgency=low
22
23 * Cherry pick upstream support for resizepart and the
24
25=== modified file 'libblkid/src/superblocks/udf.c'
26--- libblkid/src/superblocks/udf.c 2011-11-03 15:38:23 +0000
27+++ libblkid/src/superblocks/udf.c 2013-04-04 20:35:26 +0000
28@@ -63,17 +63,25 @@
29 struct volume_descriptor *vd;
30 struct volume_structure_descriptor *vsd;
31 unsigned int bs;
32+ unsigned int pbs[2];
33 unsigned int b;
34 unsigned int type;
35 unsigned int count;
36 unsigned int loc;
37-
38- /* search Volume Sequence Descriptor (VSD) to get the logical
39- * block size of the volume */
40- for (bs = 0x800; bs < 0x8000; bs += 0x800) {
41+ unsigned int i;
42+
43+ /* The block size of a UDF filesystem is that of the underlying
44+ * storage; we check later on for the special case of image files,
45+ * which may have the 2048-byte block size of optical media. */
46+ pbs[0] = blkid_probe_get_sectorsize(pr);
47+ pbs[1] = 0x800;
48+
49+ /* check for a Volume Structure Descriptor (VSD); each is
50+ * 2048 bytes long */
51+ for (b = 0; b < 0x8000; b += 0x800) {
52 vsd = (struct volume_structure_descriptor *)
53 blkid_probe_get_buffer(pr,
54- UDF_VSD_OFFSET + bs,
55+ UDF_VSD_OFFSET + b,
56 sizeof(*vsd));
57 if (!vsd)
58 return 1;
59@@ -87,7 +95,7 @@
60 for (b = 0; b < 64; b++) {
61 vsd = (struct volume_structure_descriptor *)
62 blkid_probe_get_buffer(pr,
63- UDF_VSD_OFFSET + ((blkid_loff_t) b * bs),
64+ UDF_VSD_OFFSET + ((blkid_loff_t) b * 0x800),
65 sizeof(*vsd));
66 if (!vsd)
67 return -1;
68@@ -101,17 +109,24 @@
69 return -1;
70
71 anchor:
72- /* read Anchor Volume Descriptor (AVDP) */
73- vd = (struct volume_descriptor *)
74- blkid_probe_get_buffer(pr, 256 * bs, sizeof(*vd));
75- if (!vd)
76- return -1;
77-
78- type = le16_to_cpu(vd->tag.id);
79- if (type != 2) /* TAG_ID_AVDP */
80- return 0;
81-
82- /* get desriptor list address and block count */
83+ /* read Anchor Volume Descriptor (AVDP), checking block size */
84+ for (i = 0; i < 2; i++) {
85+ vd = (struct volume_descriptor *)
86+ blkid_probe_get_buffer(pr, 256 * pbs[i], sizeof(*vd));
87+ if (!vd)
88+ return -1;
89+
90+ type = le16_to_cpu(vd->tag.id);
91+ if (type == 2) /* TAG_ID_AVDP */
92+ goto real_blksz;
93+ }
94+ return 0;
95+
96+real_blksz:
97+ /* Use the actual block size from here on out */
98+ bs = pbs[i];
99+
100+ /* get descriptor list address and block count */
101 count = le32_to_cpu(vd->type.anchor.length) / bs;
102 loc = le32_to_cpu(vd->type.anchor.location);
103

Subscribers

People subscribed via source and target branches

to all changes: