Skip to content

Commit c4c86ab

Browse files
Hans Westgaard RyLeon Romanovsky
authored andcommitted
net/rds: Detect need of On-Demand-Paging memory registration
Add code to check if memory intended for RDMA is FS-DAX-memory. RDS will fail with error code EOPNOTSUPP if FS-DAX-memory is detected. Signed-off-by: Hans Westgaard Ry <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 8ffc324 commit c4c86ab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

net/rds/rdma.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,13 @@ void rds_rdma_drop_keys(struct rds_sock *rs)
156156
static int rds_pin_pages(unsigned long user_addr, unsigned int nr_pages,
157157
struct page **pages, int write)
158158
{
159+
unsigned int gup_flags = FOLL_LONGTERM;
159160
int ret;
160161

161-
ret = get_user_pages_fast(user_addr, nr_pages, write ? FOLL_WRITE : 0,
162-
pages);
162+
if (write)
163+
gup_flags |= FOLL_WRITE;
163164

165+
ret = get_user_pages_fast(user_addr, nr_pages, gup_flags, pages);
164166
if (ret >= 0 && ret < nr_pages) {
165167
while (ret--)
166168
put_page(pages[ret]);

0 commit comments

Comments
 (0)