From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 30 Mar 2007 08:48:33 +1000 Message-ID: <87slbn64zi.wl%peterc@chubb.wattle.id.au> From: Peter Chubb In-Reply-To: References: MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Subject: Re: [PATCH 1/4] holepunch: fix shmem_truncate_range punching too far Sender: owner-linux-mm@kvack.org Return-Path: To: Miklos Szeredi Cc: hugh@veritas.com, akpm@linux-foundation.org, mszeredi@suse.cz, pbadari@us.ibm.com, linux-mm@kvack.org List-ID: >>>>> "Miklos" == Miklos Szeredi writes: >> + punch_hole = 0; } else { >> - limit = (end + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; >> - if (limit > info->next_index) >> - limit = info->next_index; >> + if (end + 1 >= inode->i_size) { /* we may free a little more */ Miklos> Why end + 1? If the hole end is at 4096 and the file size is Miklos> 4097 we surely don't want to truncate that second page also? Why not simplify it to end > inode->i_size? I think it then makes more sense. -- Dr Peter Chubb http://www.gelato.unsw.edu.au peterc AT gelato.unsw.edu.au http://www.ertos.nicta.com.au ERTOS within National ICT Australia -- 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