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

Proposed by Jim Trigg
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
AUTHORS (+1/-0)
debian/changelog (+6/-0)
libblkid/src/superblocks/udf.c (+32/-17)
To merge this branch: bzr merge lp:~jtrigg/ubuntu/raring/util-linux/bug-1164683
Reviewer Review Type Date Requested Status
Dimitri John Ledkov Approve
Ubuntu branches 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.
Revision history for this message
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/

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

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

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'AUTHORS'
--- AUTHORS 2011-12-16 22:53:42 +0000
+++ AUTHORS 2013-04-04 20:35:26 +0000
@@ -282,4 +282,5 @@
282 Yann Droneaud <yann@droneaud.fr>282 Yann Droneaud <yann@droneaud.fr>
283 Yoshihiro Takahashi <ytakahashi@miraclelinux.com>283 Yoshihiro Takahashi <ytakahashi@miraclelinux.com>
284 Yu Zhiguo <yuzg@cn.fujitsu.com>284 Yu Zhiguo <yuzg@cn.fujitsu.com>
285 Zachary Catlin <z@zc.is>
285 Zdenek Behan <rain@matfyz.cz>286 Zdenek Behan <rain@matfyz.cz>
286287
=== modified file 'debian/changelog'
--- debian/changelog 2013-02-04 15:40:51 +0000
+++ debian/changelog 2013-04-04 20:35:26 +0000
@@ -1,3 +1,9 @@
1util-linux (2.20.1-5.1ubuntu9) UNRELEASED; urgency=low
2
3 * Apply upstream patch for udf bug when blocksize < 2048 (LP: #1164683)
4
5 -- Jim Trigg (jktrigg) <jtrigg@spamcop.net> Thu, 04 Apr 2013 15:42:05 -0400
6
1util-linux (2.20.1-5.1ubuntu8) raring; urgency=low7util-linux (2.20.1-5.1ubuntu8) raring; urgency=low
28
3 * Cherry pick upstream support for resizepart and the9 * Cherry pick upstream support for resizepart and the
410
=== modified file 'libblkid/src/superblocks/udf.c'
--- libblkid/src/superblocks/udf.c 2011-11-03 15:38:23 +0000
+++ libblkid/src/superblocks/udf.c 2013-04-04 20:35:26 +0000
@@ -63,17 +63,25 @@
63 struct volume_descriptor *vd;63 struct volume_descriptor *vd;
64 struct volume_structure_descriptor *vsd;64 struct volume_structure_descriptor *vsd;
65 unsigned int bs;65 unsigned int bs;
66 unsigned int pbs[2];
66 unsigned int b;67 unsigned int b;
67 unsigned int type;68 unsigned int type;
68 unsigned int count;69 unsigned int count;
69 unsigned int loc;70 unsigned int loc;
7071 unsigned int i;
71 /* search Volume Sequence Descriptor (VSD) to get the logical72
72 * block size of the volume */73 /* The block size of a UDF filesystem is that of the underlying
73 for (bs = 0x800; bs < 0x8000; bs += 0x800) {74 * storage; we check later on for the special case of image files,
75 * which may have the 2048-byte block size of optical media. */
76 pbs[0] = blkid_probe_get_sectorsize(pr);
77 pbs[1] = 0x800;
78
79 /* check for a Volume Structure Descriptor (VSD); each is
80 * 2048 bytes long */
81 for (b = 0; b < 0x8000; b += 0x800) {
74 vsd = (struct volume_structure_descriptor *)82 vsd = (struct volume_structure_descriptor *)
75 blkid_probe_get_buffer(pr,83 blkid_probe_get_buffer(pr,
76 UDF_VSD_OFFSET + bs,84 UDF_VSD_OFFSET + b,
77 sizeof(*vsd));85 sizeof(*vsd));
78 if (!vsd)86 if (!vsd)
79 return 1;87 return 1;
@@ -87,7 +95,7 @@
87 for (b = 0; b < 64; b++) {95 for (b = 0; b < 64; b++) {
88 vsd = (struct volume_structure_descriptor *)96 vsd = (struct volume_structure_descriptor *)
89 blkid_probe_get_buffer(pr,97 blkid_probe_get_buffer(pr,
90 UDF_VSD_OFFSET + ((blkid_loff_t) b * bs),98 UDF_VSD_OFFSET + ((blkid_loff_t) b * 0x800),
91 sizeof(*vsd));99 sizeof(*vsd));
92 if (!vsd)100 if (!vsd)
93 return -1;101 return -1;
@@ -101,17 +109,24 @@
101 return -1;109 return -1;
102110
103anchor:111anchor:
104 /* read Anchor Volume Descriptor (AVDP) */112 /* read Anchor Volume Descriptor (AVDP), checking block size */
105 vd = (struct volume_descriptor *)113 for (i = 0; i < 2; i++) {
106 blkid_probe_get_buffer(pr, 256 * bs, sizeof(*vd));114 vd = (struct volume_descriptor *)
107 if (!vd)115 blkid_probe_get_buffer(pr, 256 * pbs[i], sizeof(*vd));
108 return -1;116 if (!vd)
109117 return -1;
110 type = le16_to_cpu(vd->tag.id);118
111 if (type != 2) /* TAG_ID_AVDP */119 type = le16_to_cpu(vd->tag.id);
112 return 0;120 if (type == 2) /* TAG_ID_AVDP */
113121 goto real_blksz;
114 /* get desriptor list address and block count */122 }
123 return 0;
124
125real_blksz:
126 /* Use the actual block size from here on out */
127 bs = pbs[i];
128
129 /* get descriptor list address and block count */
115 count = le32_to_cpu(vd->type.anchor.length) / bs;130 count = le32_to_cpu(vd->type.anchor.length) / bs;
116 loc = le32_to_cpu(vd->type.anchor.location);131 loc = le32_to_cpu(vd->type.anchor.location);
117132

Subscribers

People subscribed via source and target branches

to all changes: