On Wed, Aug 10, 2011 at 5:56 AM, Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> wrote:
On 09/08/11 22:54, William Hahne wrote:

The code for checking for a wrapped HFS+ volume looks at the wrong offset.

Index: fs/hfsplus/hfsp_volume.c
===================================================================
--- fs/hfsplus/hfsp_volume.c (revision 1041)
+++ fs/hfsplus/hfsp_volume.c (working copy)
@@ -302,7 +302,7 @@
os_read(fd, vol, 2, HFSP_BLOCKSZ_BITS);
if (__be16_to_cpu(vol[0]) == HFS_VOLHEAD_SIG &&
- __be16_to_cpu(vol[0x7c]) == HFSP_VOLHEAD_SIG) {
+ __be16_to_cpu(vol[0x3e]) == HFSP_VOLHEAD_SIG) {
ret = -1;
} else if (__be16_to_cpu(vol[0]) == HFSP_VOLHEAD_SIG) {
ret = -1;

Same comment as for patch 2/10.


Actually I think this one is not contrary to the specification but is just a mix up between a 8bit and 16bit array. The original value seems to assume that vol is an array of 8bit integers while it is an array of 16bit integers. If you notice the corrected value is half of the original value. I can look up the documentation but it seems unnecessary in this case.
 

ATB,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs

--
OpenBIOS                 http://openbios.org/
Mailinglist:  http://lists.openbios.org/mailman/listinfo
Free your System - May the Forth be with you

William Hahne