IB/core: Fix mismatch between locked and pinned pages
authorYishai Hadas <yishaih@mellanox.com>
Thu, 10 May 2012 20:28:05 +0000 (23:28 +0300)
committerRoland Dreier <roland@purestorage.com>
Fri, 11 May 2012 18:38:22 +0000 (11:38 -0700)
Commit bc3e53f682d9 ("mm: distinguish between mlocked and pinned
pages") introduced a separate counter for pinned pages and used it in
the IB stack.  However, in ib_umem_get() the pinned counter is
incremented, but ib_umem_release() wrongly decrements the locked
counter.  Fix this.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Reviewed-by: Christoph Lameter <cl@linux.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/core/umem.c

index 71f0c0f7df949ac0a104f50cc3b1900d3751d308..a84112322071015a78b7916bfe70250284f1640e 100644 (file)
@@ -269,7 +269,7 @@ void ib_umem_release(struct ib_umem *umem)
        } else
                down_write(&mm->mmap_sem);
 
-       current->mm->locked_vm -= diff;
+       current->mm->pinned_vm -= diff;
        up_write(&mm->mmap_sem);
        mmput(mm);
        kfree(umem);