From: Danil Kipnis <danil.kipnis@cloud.ionos.com>
To: haris iqbal <haris.phnx@gmail.com>
Cc: linux-block@vger.kernel.org, linux-rdma@vger.kernel.org,
Jinpu Wang <jinpu.wang@cloud.ionos.com>,
Jens Axboe <axboe@kernel.dk>, Doug Ledford <dledford@redhat.com>,
Jason Gunthorpe <jgg@ziepe.ca>
Subject: Re: [PATCH] RDMA/rtrs: server: use already dereferenced rtrs_sess structure
Date: Fri, 22 May 2020 12:01:10 +0200 [thread overview]
Message-ID: <CAHg0HuwK3FepXP06o-S_y6hukYmF3sMRgU+RweB6EMWdF3y9TQ@mail.gmail.com> (raw)
In-Reply-To: <20200522082833.1480551-1-haris.phnx@gmail.com>
On Fri, May 22, 2020 at 10:28 AM <haris.phnx@gmail.com> wrote:
>
> From: Md Haris Iqbal <haris.phnx@gmail.com>
>
> The rtrs_sess structure has already been extracted above from the
> rtrs_srv_sess structure. Use that to avoid redundant dereferencing.
>
> Fixes: 9cb837480424 ("RDMA/rtrs: server: main functionality")
> Signed-off-by: Md Haris Iqbal <haris.phnx@gmail.com>
> ---
> drivers/infiniband/ulp/rtrs/rtrs-srv.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
> index 1fc6ece036ff..5ef8988ee75b 100644
> --- a/drivers/infiniband/ulp/rtrs/rtrs-srv.c
> +++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
> @@ -1822,13 +1822,13 @@ static int rtrs_rdma_connect(struct rdma_cm_id *cm_id,
> /*
> * Sanity checks
> */
> - if (con_num != sess->s.con_num || cid >= sess->s.con_num) {
> + if (con_num != s->con_num || cid >= s->con_num) {
> rtrs_err(s, "Incorrect request: %d, %d\n",
> cid, con_num);
> mutex_unlock(&srv->paths_mutex);
> goto reject_w_econnreset;
> }
> - if (sess->s.con[cid]) {
> + if (s->con[cid]) {
> rtrs_err(s, "Connection already exists: %d\n",
> cid);
> mutex_unlock(&srv->paths_mutex);
> --
> 2.25.1
>
Acked-by: Danil Kipnis <danil.kipnis@cloud.ionos.com>
Thanks Haris.
next prev parent reply other threads:[~2020-05-22 10:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-22 8:28 [PATCH] RDMA/rtrs: server: use already dereferenced rtrs_sess structure haris.phnx
2020-05-22 10:01 ` Danil Kipnis [this message]
2020-05-23 0:25 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHg0HuwK3FepXP06o-S_y6hukYmF3sMRgU+RweB6EMWdF3y9TQ@mail.gmail.com \
--to=danil.kipnis@cloud.ionos.com \
--cc=axboe@kernel.dk \
--cc=dledford@redhat.com \
--cc=haris.phnx@gmail.com \
--cc=jgg@ziepe.ca \
--cc=jinpu.wang@cloud.ionos.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).