Message ID | 20221116111400.7203-4-guoqing.jiang@linux.dev (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Misc patches for rtrs | expand |
On Wed, Nov 16, 2022 at 12:14 PM Guoqing Jiang <guoqing.jiang@linux.dev> wrote: > > We should check with nr_sgt, also the only successful case is that > all sg elements are mapped, so make it explict. typo, s/explicit/explicitly. > > Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev> > --- > drivers/infiniband/ulp/rtrs/rtrs-srv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c b/drivers/infiniband/ulp/rtrs/rtrs-srv.c > index b877dd57b6b9..581c850e71d6 100644 > --- a/drivers/infiniband/ulp/rtrs/rtrs-srv.c > +++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c > @@ -622,7 +622,7 @@ static int map_cont_bufs(struct rtrs_srv_path *srv_path) > } > nr = ib_map_mr_sg(mr, sgt->sgl, nr_sgt, > NULL, max_chunk_size); > - if (nr < 0 || nr < sgt->nents) { > + if (nr != nr_sgt) { > err = nr < 0 ? nr : -EINVAL; > goto dereg_mr; > } > -- > 2.31.1 > Acked-by: Jack Wang <jinpu.wang@ionos.com>
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c b/drivers/infiniband/ulp/rtrs/rtrs-srv.c index b877dd57b6b9..581c850e71d6 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-srv.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c @@ -622,7 +622,7 @@ static int map_cont_bufs(struct rtrs_srv_path *srv_path) } nr = ib_map_mr_sg(mr, sgt->sgl, nr_sgt, NULL, max_chunk_size); - if (nr < 0 || nr < sgt->nents) { + if (nr != nr_sgt) { err = nr < 0 ? nr : -EINVAL; goto dereg_mr; }
We should check with nr_sgt, also the only successful case is that all sg elements are mapped, so make it explict. Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev> --- drivers/infiniband/ulp/rtrs/rtrs-srv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)