Re: [RFC][PATCH] Fix for latent bug in vmtruncate()
From: William Lee Irwin III <hidden>
Date: 2003-05-13 21:53:49
Also in:
lkml
From: William Lee Irwin III <hidden>
Date: 2003-05-13 21:53:49
Also in:
lkml
On Tue, May 13, 2003 at 01:58:07PM -0700, Paul E. McKenney wrote:
The vmtruncate() function shifts down by PAGE_CACHE_SHIFT, then calls vmtruncate_list(), which deals in terms of PAGE_SHIFT instead. Currently, no harm done, since PAGE_CACHE_SHIFT and PAGE_SHIFT are identical. Some day they might not be, hence this patch. I also took the liberty of modifying a hand-coded "if" that seems to optimize for files that are not mapped to instead use unlikely().
pgoff describes a file offset in the same units used to map files with (the size of an area covered by a PTE), which is PAGE_SIZE (in mainline; elsewhere it's called MMUPAGE_SIZE and I had to fix this already for my tree). When they differ this would lose the offset into the PAGE_CACHE_SIZE-sized file page; hence, well-spotted. -- wli -- 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: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>