On Wed, 25 Oct 2006, David Gibson wrote: > On Wed, Oct 25, 2006 at 08:23:13AM +0300, Mika Penttilä wrote: > > Shouldn't it be something like following ? > > > > size = (i_size_read(mapping->host) + HPAGE_SIZE - 1) >> HPAGE_SHIFT; > > > > If so this was wrong in the original code also. > > In theory, yes, but AFAIK there is no way to get an i_size on a > hugetlbfs file which is not a multiple of HPAGE_SIZE. Exactly. Hugh