[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d35ade5f-bee3-d2df-98c1-9793db146f00@oracle.com>
Date: Fri, 26 Apr 2019 10:37:02 +0800
From: Yanjun Zhu <yanjun.zhu@...cle.com>
To: Santosh Shilimkar <santosh.shilimkar@...cle.com>,
netdev@...r.kernel.org, davem@...emloft.net
Subject: Re: [net-next][PATCH 1/2] rds: handle unsupported rdma request to fs
dax memory
On 2019/4/26 8:44, Santosh Shilimkar wrote:
> From: Hans Westgaard Ry <hans.westgaard.ry@...cle.com>
>
> RDS doesn't support RDMA on memory apertures that require On Demand
> Paging (ODP), such as FS DAX memory. User applications can try to use
> RDS to perform RDMA over such memories and since it doesn't report any
> failure, it can lead to unexpected issues like memory corruption when
> a couple of out of sync file system operations like ftruncate etc. are
> performed.
>
> The patch adds a check so that such an attempt to RDMA to/from memory
> apertures requiring ODP will fail.
>
> Reviewed-by: HÃ¥kon Bugge <haakon.bugge@...cle.com>
> Reviewed-tested-by: Zhu Yanjun <yanjun.zhu@...cle.com>
Thanks a lot. Santosh.
Zhu Yanjun
> Signed-off-by: Hans Westgaard Ry <hans.westgaard.ry@...cle.com>
> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@...cle.com>
> ---
> net/rds/rdma.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/net/rds/rdma.c b/net/rds/rdma.c
> index 182ab84..5010100 100644
> --- a/net/rds/rdma.c
> +++ b/net/rds/rdma.c
> @@ -158,8 +158,9 @@ static int rds_pin_pages(unsigned long user_addr, unsigned int nr_pages,
> {
> int ret;
>
> - ret = get_user_pages_fast(user_addr, nr_pages, write, pages);
> -
> + /* get_user_pages return -EOPNOTSUPP for fs_dax memory */
> + ret = get_user_pages_longterm(user_addr, nr_pages,
> + write, pages, NULL);
> if (ret >= 0 && ret < nr_pages) {
> while (ret--)
> put_page(pages[ret]);
Powered by blists - more mailing lists