Skip to content

Commit

Permalink
smc: fix sendpage() call
Browse files Browse the repository at this point in the history
The sendpage() call grabs the sock lock before calling the default
implementation - which tries to grab it once again.

Signed-off-by: Stefan Raspl <raspl@linux.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com><
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stefan Raspl authored and davem330 committed May 3, 2018
1 parent a6920d1 commit bda27ff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/smc/af_smc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1315,16 +1315,18 @@ static ssize_t smc_sendpage(struct socket *sock, struct page *page,

smc = smc_sk(sk);
lock_sock(sk);
if (sk->sk_state != SMC_ACTIVE)
if (sk->sk_state != SMC_ACTIVE) {
release_sock(sk);
goto out;
}
release_sock(sk);
if (smc->use_fallback)
rc = kernel_sendpage(smc->clcsock, page, offset,
size, flags);
else
rc = sock_no_sendpage(sock, page, offset, size, flags);

out:
release_sock(sk);
return rc;
}

Expand Down

0 comments on commit bda27ff

Please sign in to comment.