From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [RFC] block_dev:Fix bug when read/write block-device which is larger than 16TB in 32bit-OS. Date: Tue, 24 Jul 2012 09:48:38 -0400 Message-ID: <20120724134838.GA26102@infradead.org> References: <201205291656322966937@gmail.com> <201207242044249532601@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , "viro@ZenIV.linux.org.uk" , linux-fsdevel , linux-mm To: majianpeng Return-path: Content-Disposition: inline In-Reply-To: <201207242044249532601@gmail.com> Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Tue, Jul 24, 2012 at 08:44:27PM +0800, majianpeng wrote: > On 2012-05-29 16:56 majianpeng Wrote: > >The size of block-device is larger than 16TB, and the os is 32bit. > >If the offset of read/write is larger then 16TB. The index of address_space will > >overflow and supply data from low offset instead. We can't support > 16TB block device on 32-bit systems with 4k page size, just like we can't support files that large. For filesystems the s_maxbytes limit of MAX_LFS_FILESIZE takes care of that, but it seems like we miss that check for block devices. The proper fix is to add that check (either via s_maxbytes or by checking MAX_LFS_FILESIZE) to generic_write_checks and generic_file_aio_read (or a block device specific wrapper) -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org