From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Ursula Braun <ubraun@linux.ibm.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
kbuild@01.org, kbuild-all@01.org, davem@davemloft.net,
netdev@vger.kernel.org, linux-s390@vger.kernel.org,
schwidefsky@de.ibm.com, raspl@linux.ibm.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 2/5] net/smc: remove duplicate mutex_unlock
Date: Tue, 2 Oct 2018 08:46:40 +0200 [thread overview]
Message-ID: <20181002064640.GA16762@osiris> (raw)
In-Reply-To: <c0fe2ae3-38b4-5023-9140-20f7acac6028@linux.ibm.com>
On Mon, Oct 01, 2018 at 05:22:22PM +0200, Ursula Braun wrote:
>
> > 3b2dec260 Hans Wippel 2018-05-18 1282 /* finish worker */
> > c69342ef9 Ursula Braun 2018-09-18 1283 if (!ism_supported) {
> > c69342ef9 Ursula Braun 2018-09-18 1284 if (smc_listen_rdma_finish(new_smc, &cclc, local_contact))
> > c69342ef9 Ursula Braun 2018-09-18 1285 return;
> > ^^^^^^
> > We need to mutex_unlock(&smc_create_lgr_pending); before the return.
> >
>
> The smatch warning is not necessary, since the mutex_unlock(&smc_create_lgr_pending)
> for this case is done within smc_listen_rdma_finish().
>
> > c69342ef9 Ursula Braun 2018-09-18 1286 }
> > 3b2dec260 Hans Wippel 2018-05-18 1287 smc_conn_save_peer_info(new_smc, &cclc);
> > 3b2dec260 Hans Wippel 2018-05-18 1288 mutex_unlock(&smc_create_lgr_pending);
> > 3b2dec260 Hans Wippel 2018-05-18 @1289 smc_listen_out_connected(new_smc);
> > a046d57da Ursula Braun 2017-01-09 1290 }
> > a046d57da Ursula Braun 2017-01-09 1291
> >
> > ---
> > 0-DAY kernel test infrastructure Open Source Technology Center
> > https://lists.01.org/pipermail/kbuild-all Intel Corporation
> >
>
> But you could argue the code confuses smatch and other readers. Thus I could improve
> readability with a patch like this:
Yes, please.
> ---
> net/smc/af_smc.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> --- a/net/smc/af_smc.c
> +++ b/net/smc/af_smc.c
> @@ -1184,7 +1184,6 @@ static int smc_listen_rdma_finish(struct
> return 0;
>
> decline:
> - mutex_unlock(&smc_create_lgr_pending);
> smc_listen_decline(new_smc, reason_code, local_contact);
> return reason_code;
> }
The lonely mutex_unlock() also _looks_ like a bug ;)
next prev parent reply other threads:[~2018-10-02 6:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-18 13:46 [PATCH net 0/5] net/smc: fixes 2018-09-18 Ursula Braun
2018-09-18 13:46 ` [PATCH net 1/5] net/smc: fix non-blocking connect problem Ursula Braun
2018-09-18 13:46 ` [PATCH net 2/5] net/smc: remove duplicate mutex_unlock Ursula Braun
2018-09-20 9:12 ` Dan Carpenter
2018-10-01 15:22 ` Ursula Braun
2018-10-02 6:46 ` Heiko Carstens [this message]
2018-09-18 13:46 ` [PATCH net 3/5] net/smc: enable fallback for connection abort in state INIT Ursula Braun
2018-09-18 13:46 ` [PATCH net 4/5] net/smc: no urgent data check for listen sockets Ursula Braun
2018-09-18 13:46 ` [PATCH net 5/5] net/smc: fix sizeof to int comparison Ursula Braun
2018-09-19 3:12 ` [PATCH net 0/5] net/smc: fixes 2018-09-18 David Miller
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=20181002064640.GA16762@osiris \
--to=heiko.carstens@de.ibm.com \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=kbuild-all@01.org \
--cc=kbuild@01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=raspl@linux.ibm.com \
--cc=schwidefsky@de.ibm.com \
--cc=ubraun@linux.ibm.com \
/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).