From: Hin-Tak Leung <hintak_leung@yahoo.co.uk>
To: Pavel Ivanov <paivanof@gmail.com>
Cc: linux-fsdevel@vger.kernel.org,
linux-kernel <linux-kernel@vger.kernel.org>,
Christoph Hellwig <hch@tuxera.com>
Subject: Re: Kernel 3.1.0-rc4 oops when connecting iPod
Date: Sun, 11 Sep 2011 14:46:08 +0100 (BST) [thread overview]
Message-ID: <1315748768.65310.YahooMailClassic@web29513.mail.ird.yahoo.com> (raw)
In-Reply-To: <CAG1a4rt5wLihR-ZkUD78WRbHk39xWP0ypJzMe4K5G1O-k12-MQ@mail.gmail.com>
--- On Sun, 11/9/11, Pavel Ivanov <paivanof@gmail.com> wrote:
> How about the following patch?
>
>
> Subject: [PATCH] hfsplus: Allow to mount filesystem with
> block size
> greater than PAGE_SIZE
>
> Commit c6d5f5fa (hfsplus: lift the 2TB size limit) added
> call to
> generic_check_addressable() but used the system's internal
> block size
> which can be larger than PAGE_SIZE and will cause
> generic_check_addressable() to return -EINVAL in this case.
> This
> results in impossibility to mount file systems with such
> block sizes.
> To fix it we have to use block size understandable by
> generic_check_addressable() and adjust number of blocks
> accordingly.
>
> Signed-off-by: Pavel Ivanov <paivanof@gmail.com>
> Cc: <stable@kernel.org>
> ---
>
> diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
> index c106ca2..26ac5a5 100644
> --- a/fs/hfsplus/super.c
> +++ b/fs/hfsplus/super.c
> @@ -399,8 +399,17 @@ static int hfsplus_fill_super(struct
> super_block
> *sb, void *data, int silent)
> if (!sbi->rsrc_clump_blocks)
>
> sbi->rsrc_clump_blocks = 1;
>
> - err =
> generic_check_addressable(sbi->alloc_blksz_shift,
> -
>
> sbi->total_blocks);
> + /*
> + * Check that filesystem data
> can be addressed by sector_t. Obvious way
> + * to do that is to call
> generic_check_addressable with alloc_blksz_shift
> + * and total_blocks as
> parameters. But alloc_blksz_shift can be greater
> + * than PAGE_SIZE_SHIFT and
> in this case it won't be accepted by
> + * generic_check_addressable.
> s_blocksize_bits will always be accepted
> + * and difference between it
> and alloc_blksz_shift will be always in
> + * fs_shift.
> + */
> + err =
> generic_check_addressable(sb->s_blocksize_bits,
> +
> (u64)sbi->total_blocks << sbi->fs_shift);
> if (err) {
> printk(KERN_ERR
> "hfs: filesystem size too large.\n");
> goto out_free_vhdr;
Why is the u64 needed? If it is needed, it probably means sbi->total_blocks should have been u64 in the first place.
WARNING: multiple messages have this Message-ID (diff)
From: Hin-Tak Leung <hintak_leung@yahoo.co.uk>
To: Pavel Ivanov <paivanof@gmail.com>
Cc: linux-fsdevel@vger.kernel.org,
linux-kernel <linux-kernel@vger.kernel.org>,
Christoph Hellwig <hch@tuxera.com>
Subject: Re: Kernel 3.1.0-rc4 oops when connecting iPod
Date: Sun, 11 Sep 2011 14:46:08 +0100 (BST) [thread overview]
Message-ID: <1315748768.65310.YahooMailClassic@web29513.mail.ird.yahoo.com> (raw)
In-Reply-To: <CAG1a4rt5wLihR-ZkUD78WRbHk39xWP0ypJzMe4K5G1O-k12-MQ@mail.gmail.com>
--- On Sun, 11/9/11, Pavel Ivanov <paivanof@gmail.com> wrote:
> How about the following patch?
>
>
> Subject: [PATCH] hfsplus: Allow to mount filesystem with
> block size
> greater than PAGE_SIZE
>
> Commit c6d5f5fa (hfsplus: lift the 2TB size limit) added
> call to
> generic_check_addressable() but used the system's internal
> block size
> which can be larger than PAGE_SIZE and will cause
> generic_check_addressable() to return -EINVAL in this case.
> This
> results in impossibility to mount file systems with such
> block sizes.
> To fix it we have to use block size understandable by
> generic_check_addressable() and adjust number of blocks
> accordingly.
>
> Signed-off-by: Pavel Ivanov <paivanof@gmail.com>
> Cc: <stable@kernel.org>
> ---
>
> diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
> index c106ca2..26ac5a5 100644
> --- a/fs/hfsplus/super.c
> +++ b/fs/hfsplus/super.c
> @@ -399,8 +399,17 @@ static int hfsplus_fill_super(struct
> super_block
> *sb, void *data, int silent)
> if (!sbi->rsrc_clump_blocks)
>
> sbi->rsrc_clump_blocks = 1;
>
> - err =
> generic_check_addressable(sbi->alloc_blksz_shift,
> -
>
> sbi->total_blocks);
> + /*
> + * Check that filesystem data
> can be addressed by sector_t. Obvious way
> + * to do that is to call
> generic_check_addressable with alloc_blksz_shift
> + * and total_blocks as
> parameters. But alloc_blksz_shift can be greater
> + * than PAGE_SIZE_SHIFT and
> in this case it won't be accepted by
> + * generic_check_addressable.
> s_blocksize_bits will always be accepted
> + * and difference between it
> and alloc_blksz_shift will be always in
> + * fs_shift.
> + */
> + err =
> generic_check_addressable(sb->s_blocksize_bits,
> +
> (u64)sbi->total_blocks << sbi->fs_shift);
> if (err) {
> printk(KERN_ERR
> "hfs: filesystem size too large.\n");
> goto out_free_vhdr;
Why is the u64 needed? If it is needed, it probably means sbi->total_blocks should have been u64 in the first place.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-09-11 13:46 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-03 3:08 Kernel 3.1.0-rc4 oops when connecting iPod Pavel Ivanov
2011-09-03 3:59 ` Hin-Tak Leung
2011-09-03 3:59 ` Hin-Tak Leung
2011-09-03 4:37 ` Pavel Ivanov
2011-09-03 6:57 ` Hin-Tak Leung
2011-09-03 20:52 ` Pavel Ivanov
2011-09-03 20:52 ` Pavel Ivanov
2011-09-03 23:35 ` Hin-Tak Leung
2011-09-03 23:35 ` Hin-Tak Leung
2011-09-03 23:59 ` Pavel Ivanov
2011-09-03 23:59 ` Pavel Ivanov
2011-09-04 0:37 ` Hin-Tak Leung
2011-09-06 4:35 ` Pavel Ivanov
2011-09-06 4:35 ` Pavel Ivanov
2011-09-06 5:12 ` Hin-Tak Leung
2011-09-06 5:12 ` Hin-Tak Leung
2011-09-06 15:09 ` Pavel Ivanov
2011-09-06 15:09 ` Pavel Ivanov
2011-09-11 3:52 ` Pavel Ivanov
2011-09-11 3:52 ` Pavel Ivanov
2011-09-11 13:46 ` Hin-Tak Leung [this message]
2011-09-11 13:46 ` Hin-Tak Leung
2011-09-11 14:14 ` Christoph Hellwig
2011-09-11 14:12 ` Christoph Hellwig
2011-09-12 14:34 ` Christoph Hellwig
2011-09-12 15:19 ` Pavel Ivanov
2011-09-12 15:19 ` Pavel Ivanov
2011-09-12 15:31 ` Christoph Hellwig
2011-09-13 2:20 ` Pavel Ivanov
2011-09-13 2:20 ` Pavel Ivanov
2011-09-14 17:42 ` Christoph Hellwig
2011-09-15 14:35 ` Christoph Hellwig
2011-09-12 15:57 ` Hin-Tak Leung
2011-09-07 17:59 ` Seth Forshee
2011-09-07 17:59 ` Seth Forshee
2011-09-08 3:13 ` Hin-Tak Leung
2011-09-08 3:13 ` Hin-Tak Leung
2011-09-08 16:23 ` Seth Forshee
2011-09-09 12:48 ` Christoph Hellwig
2011-09-11 3:32 ` Pavel Ivanov
2011-09-11 3:32 ` Pavel Ivanov
2011-09-11 14:10 ` Christoph Hellwig
2011-09-12 14:00 ` Pavel Ivanov
2011-09-12 15:27 ` [PATCH] hfsplus: Fix kfree of wrong vhdr pointers Seth Forshee
2011-09-12 15:28 ` Christoph Hellwig
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=1315748768.65310.YahooMailClassic@web29513.mail.ird.yahoo.com \
--to=hintak_leung@yahoo.co.uk \
--cc=hch@tuxera.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paivanof@gmail.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.