Re: [PATCH] hfsplus: Refuse to mount volumes larger than 2TB

Ben Hutchings
2009-10-11T17:02:13Z

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

On Sun, 2009-10-11 at 00:51 -0700, Andrew Morton wrote:
[...]
> > --- a/fs/hfsplus/wrapper.c
> > +++ b/fs/hfsplus/wrapper.c
> > @@ -99,6 +99,10 @@
> >
> > if (hfsplus_get_last_session(sb, &part_start, &part_size))
> > return -EINVAL;
> > + if (part_start + part_size > 0x100000000) {
> > + pr_err("hfs: volumes larger than 2TB are not supported yet\n");
> > + return -EINVAL;
> > + }
>
> part_start and part_size are sector_t. This code will do weird overflow
> things when sector_t is 32-bit.

Sorry, I forgot CONFIG_LBD is still optional.

> Also 32-bit compilers will get upset at the excessively large hex constant.
[...]

Good point.

Ben.

--
Ben Hutchings
DNRC Motto: I can please only one person per day.
Today is not your day. Tomorrow isn't looking good either.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]