In orangefs_readahead(): loff_t bytes_remaining = inode->i_size - readahead_pos(rac); loff_t pages_remaining = bytes_remaining / PAGE_SIZE; What happens if bytes_remaining < PAGE_SIZE? Or even what happens if bytes_remaining % PAGE_SIZE != 0? if ((ret = wait_for_direct_io(ORANGEFS_IO_READ, inode, &offset, &iter, readahead_length(rac), inode->i_size, NULL, NULL, file)) < 0) I wonder if you should use iov_length(&iter) rather than readahead_length(rac). They *should* be the same. Also, should you cache inode->i_size lest it change under you due to truncate? David