Messages in this thread | | | Date | Thu, 29 Jan 2009 10:16:23 +0900 | From | Daisuke Nishimura <> | Subject | Re: [PATCH] migration: migrate_vmas should check "vma" |
| |
On Wed, 28 Jan 2009 17:55:12 +0100, Johannes Weiner <hannes@cmpxchg.org> wrote: > On Wed, Jan 28, 2009 at 11:42:36AM -0500, Christoph Lameter wrote: > > On Wed, 28 Jan 2009, Daisuke Nishimura wrote: > > > > > migrate_vmas() should check "vma" not "vma->vm_next" for for-loop condition. > > > > The loop condition is checked before vma = vma->vm_next. So the last > > iteration of the loop will now be run with vma = NULL? > > No, the condition is always checked before the body is executed. The > assignment to vma->vm_next happens at the end of every body. > So, I think in current code the loop body is not executed about the last vma in the list.
Thanks, Daisuke Nishimura.
> Try this: > > int a = 2; > > for (puts("init"); puts("cond"), a; puts("next")) > a--; > > Hannes
| |