From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Subject: Re: [patch|rfc] block: don't mark buffers beyond end of disk as mapped Date: Wed, 2 May 2012 00:26:55 +1000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, jaxboe@fusionio.com, Kyle McMartin To: Jeff Moyer Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On 2 May 2012 00:08, Jeff Moyer wrote: > Nick Piggin writes: > >> Not a bad fix. But it's kind of sad to have i_size checking logic also in >> block_read_full_page, that does not cope with this. >> >> I have found there are parts of the kernel (readahead) that try to read >> beyond EOF and seem to get angry if we return an error (by not >> marking uptodate in readpage) in that case though :( >> >> But, either way, I think it's very reasonable to not mark buffers beyond >> end of device as mapped. So I think your patch is fine. >> >> I guess for ext[234], it does not read metadata close to the end of the >> device or you were using 4K sized blocks? > > Well, the test case just reads directly from the loop device, bypassing > the file system, and I did use 1KB blocks when making the file system, so > it is quite puzzling. It's because buffer_head creation does not go through the same paths for bdev file access versus getblk APIs. blkdev_get_block does the right thing there In fact, it's probably good to unify the checks here, i.e., use max_blocks() Thanks, Nick