net/rds: Track user mapped pages through special API
authorLeon Romanovsky <leonro@mellanox.com>
Wed, 12 Feb 2020 03:03:55 +0000 (19:03 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Feb 2020 02:37:09 +0000 (18:37 -0800)
commit0d4597c8c5abdeeaf50774066c16683f30184dc8
treecde01b655ba009b31318bbc9336f3b204b249d41
parentafecdb376bd81d7e16578f0cfe82a1aec7ae18f3
net/rds: Track user mapped pages through special API

Convert net/rds to use the newly introduces pin_user_pages() API,
which properly sets FOLL_PIN. Setting FOLL_PIN is now required for
code that requires tracking of pinned pages.

Note that this effectively changes the code's behavior: it now
ultimately calls set_page_dirty_lock(), instead of set_page_dirty().
This is probably more accurate.

As Christoph Hellwig put it, "set_page_dirty() is only safe if we are
dealing with a file backed page where we have reference on the inode it
hangs off." [1]

[1] https://lore.kernel.org/r/20190723153640.GB720@lst.de

Cc: Hans Westgaard Ry <hans.westgaard.ry@oracle.com>
Cc: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/rdma.c