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

From: Ben Hutchings
Date: Sun Oct 11 2009 - 13:03:04 EST


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: signature.asc
Description: This is a digitally signed message part