From: Jan Kara Subject: Re: [PATCH] Fix minixfs size check Date: Tue, 15 May 2012 01:02:40 +0200 Message-ID: <20120514230240.GZ5353@quack.suse.cz> References: <4FAFBBC7.9020101@gmail.com> <20120514221948.GV5353@quack.suse.cz> <4FB18850.8090704@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Jan Kara , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org To: Vladimir =?utf-8?Q?'=CF=86-coder=2Fphcoder'?= Serbinenko Return-path: Content-Disposition: inline In-Reply-To: <4FB18850.8090704@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue 15-05-12 00:33:52, Vladimir '=CF=86-coder/phcoder' Serbinenko wr= ote: > On 15.05.2012 00:19, Jan Kara wrote: >=20 > > On Sun 13-05-12 15:48:55, Vladimir '=CF=86-coder/phcoder' Serbinenk= o wrote: > >> minixfs file size check is buggy and it doesn't allow creating a b= lock which > >> can't be fully filled > > Umm, I'm not really minix expert but who'd set s_max_size to some= thing > > which is not a multiple of block size? This looks rather artifical = problem > > to me... > >=20 >=20 > The usual and natural limit comes from interpreting 32-bit size field= as > signed or unsigned. So it's either 2G - 1 or 4G - 1. Neither of which= is > a multiple of block size. Oh, right. Then your patch should be OK, just it's enough to cast one= of the arguments to u64. And BTW looking at minix, it should also set s_maxbytes to s_max_size. Otherwise it will be always limited by MAX_NON_LFS which is 2^31-1. Honza --=20 Jan Kara SUSE Labs, CR