[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1380724087-13927-26-git-send-email-jack@suse.cz>
Date: Wed, 2 Oct 2013 16:28:06 +0200
From: Jan Kara <jack@...e.cz>
To: LKML <linux-kernel@...r.kernel.org>
Cc: linux-mm@...ck.org, Jan Kara <jack@...e.cz>,
Roland Dreier <roland@...nel.org>, linux-rdma@...r.kernel.org
Subject: [PATCH 25/26] ib: Convert mthca_map_user_db() to use get_user_pages_fast()
Function mthca_map_user_db() appears to call get_user_pages() without
holding mmap_sem. Fix the bug by using get_user_pages_fast() instead
which also takes care of the locking.
CC: Roland Dreier <roland@...nel.org>
CC: linux-rdma@...r.kernel.org
Signed-off-by: Jan Kara <jack@...e.cz>
---
drivers/infiniband/hw/mthca/mthca_memfree.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/mthca/mthca_memfree.c b/drivers/infiniband/hw/mthca/mthca_memfree.c
index 7d2e42dd6926..c3543b27a2a7 100644
--- a/drivers/infiniband/hw/mthca/mthca_memfree.c
+++ b/drivers/infiniband/hw/mthca/mthca_memfree.c
@@ -472,8 +472,7 @@ int mthca_map_user_db(struct mthca_dev *dev, struct mthca_uar *uar,
goto out;
}
- ret = get_user_pages(current, current->mm, uaddr & PAGE_MASK, 1, 1, 0,
- pages, NULL);
+ ret = get_user_pages_fast(uaddr & PAGE_MASK, 1, 1, pages);
if (ret < 0)
goto out;
--
1.8.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists