All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: Christoph Hellwig <hch@tuxera.com>,
	Seth Forshee <seth.forshee@canonical.com>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: [PATCH] Support HFS+ not filling its device completely
Date: Fri, 01 Jun 2012 03:00:20 +0200	[thread overview]
Message-ID: <4FC81424.9050502@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1065 bytes --]

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 <phcoder@gmail.com>
---
 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 = (((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))
-- 
1.7.10

-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

                 reply	other threads:[~2012-06-01  1:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FC81424.9050502@gmail.com \
    --to=phcoder@gmail.com \
    --cc=hch@tuxera.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seth.forshee@canonical.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.