On Mon, Mar 15, 2004 at 09:08:26PM +0100, Christophe Saout wrote: > On Mon, Mar 15, 2004 at 01:51:32PM -0600, Kevin Corry wrote: > > > kcopyd_put_pages() does not walk the entire list of specified pages (it stops > > at the second-to-last one). Thus, the nr_free_pages value is off by one. Fix > > this by incrementing nr_free_pages once more after the loop completes. > > > > --- diff/drivers/md/kcopyd.c 2004-03-15 13:41:59.000000000 -0600 > > +++ source/drivers/md/kcopyd.c 2004-03-15 13:40:41.000000000 -0600 > > @@ -100,6 +100,7 @@ > > for (cursor = pl; cursor->next; cursor = cursor->next) > > Why not simply do for (cursor = pl; cursor; cursor = cursor->next)? Because I'm trying to find the last element. Cursor would be NULL at the end of your loop. - Joe