From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= Subject: [PATCH] Support HFS+ not filling its device completely Date: Fri, 01 Jun 2012 03:00:20 +0200 Message-ID: <4FC81424.9050502@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigDE98A7D9E91B2FABAEC42C03" To: Christoph Hellwig , Seth Forshee , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Return-path: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDE98A7D9E91B2FABAEC42C03 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, all. My HFS+ previously was on slightly smaller partition and was subsequently dd'ed to its current location. Mac OS X doesn't mind and I don't mind losing a little space. However Linux fails to locate second superblock and hence to mount it. This patch uses the size field from the first superblock to locate the second. Signed-off-by: Vladimir Serbinenko --- fs/hfsplus/wrapper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c index 7daf4b8..a7e1268 100644 --- a/fs/hfsplus/wrapper.c +++ b/fs/hfsplus/wrapper.c @@ -206,6 +206,9 @@ reread: set_bit(HFSPLUS_SB_HFSX, &sbi->flags); /*FALLTHRU*/ case cpu_to_be16(HFSPLUS_VOLHEAD_SIG): + part_size =3D (((u64) be32_to_cpu(sbi->s_vhdr->blocksize) + * (u64) be32_to_cpu(sbi->s_vhdr->total_blocks)) + >> HFSPLUS_SECTOR_SHIFT); break; case cpu_to_be16(HFSP_WRAP_MAGIC): if (!hfsplus_read_mdb(sbi->s_vhdr, &wd)) --=20 1.7.10 --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enigDE98A7D9E91B2FABAEC42C03 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAk/IFC8ACgkQNak7dOguQgn9DAEAl6lii0aSySdu5Ja0DWjEANWi a2MYXBAaAcLtxlJlJCwA/1id0XINOLHFoQJAKxfZy94Pic5c7aWTyqTp5HPWr2J+ =AALT -----END PGP SIGNATURE----- --------------enigDE98A7D9E91B2FABAEC42C03--