From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hin-Tak Leung Subject: Re: Kernel 3.1.0-rc4 oops when connecting iPod Date: Mon, 12 Sep 2011 16:57:30 +0100 (BST) Message-ID: <1315843050.34041.YahooMailClassic@web29505.mail.ird.yahoo.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-fsdevel@vger.kernel.org, linux-kernel , Christoph Hellwig To: Christoph Hellwig , Pavel Ivanov Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org --- On Mon, 12/9/11, Pavel Ivanov wrote: > On Mon, Sep 12, 2011 at 10:34 AM, > Christoph Hellwig > wrote: > > Does this patch fix your issues with large block > sizes? >=20 > I'll be able to try it in the evening but meanwhile I have > some comments below. >=20 > > > > > > Index: linux-2.6/fs/hfsplus/super.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- linux-2.6.orig/fs/hfsplus/super.c =A0 2011-09-12 > 09:56:58.619988416 -0400 > > +++ linux-2.6/fs/hfsplus/super.c =A0 =A0 =A0 =A02011-09-12 > 10:07:18.006651395 -0400 > > @@ -344,6 +344,7 @@ static int > hfsplus_fill_super(struct sup > > =A0 =A0 =A0 =A0struct inode *root, *inode; > > =A0 =A0 =A0 =A0struct qstr str; > > =A0 =A0 =A0 =A0struct nls_table *nls =3D NULL; > > + =A0 =A0 =A0 u64 last_fs_block, last_fs_page; > > =A0 =A0 =A0 =A0int err; > > > > =A0 =A0 =A0 =A0err =3D -EINVAL; > > @@ -399,9 +400,13 @@ static int > hfsplus_fill_super(struct sup > > =A0 =A0 =A0 =A0if (!sbi->rsrc_clump_blocks) > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sbi->rsrc_clump_blocks =3D 1; > > > > - =A0 =A0 =A0 err =3D > generic_check_addressable(sbi->alloc_blksz_shift, > > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 sbi->total_blocks); > > - =A0 =A0 =A0 if (err) { > > + =A0 =A0 =A0 err =3D -EFBIG; > > + =A0 =A0 =A0 last_fs_block =3D sbi->total_blocks - 1; > > + =A0 =A0 =A0 last_fs_page =3D (last_fs_block >> > sbi->alloc_blksz_shift) << > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 PAGE_CACHE_SHIFT; >=20 > Did you mix left and right shifts here? Expression doesn't > make sense to me. >=20 > Also I have a little concern about consistency in using > PAGE_CACHE_SHIFT and PAGE_SHIFT. hfsplus_read_wrapper() > limits visible > block size to PAGE_SIZE, not PAGE_CACHE_SIZE. And although > now they > are equal comment in linux/pagemap.h clearly says that > PAGE_CACHE_SIZE > can be bigger than PAGE_SIZE. Is it something that should > be fixed in > hfsplus_read_wrapper() ? >=20 > > + > > + =A0 =A0 =A0 if ((last_fs_block > (sector_t)(~0ULL) > >> (sbi->alloc_blksz_shift - 9)) || >=20 > Maybe this 9 should be extracted from here and > generic_check_addressable() into some macro? >=20 > > + =A0 =A0 =A0 =A0 =A0 (last_fs_page > (pgoff_t)(~0ULL))) > { > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printk(KERN_ERR "hfs: > filesystem size too large.\n"); > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out_free_vhdr; > > =A0 =A0 =A0 =A0} > > I 2nd that this is kind of ugly. The literal "9". How about abstracting= this logic out to say, hfs_check_addressable()?