static int smc_shutdown(struct socket *sock, int how)
 {
        struct sock *sk = sock->sk;
+       bool do_shutdown = true;
        struct smc_sock *smc;
        int rc = -EINVAL;
+       int old_state;
        int rc1 = 0;
 
        smc = smc_sk(sk);
        }
        switch (how) {
        case SHUT_RDWR:         /* shutdown in both directions */
+               old_state = sk->sk_state;
                rc = smc_close_active(smc);
+               if (old_state == SMC_ACTIVE &&
+                   sk->sk_state == SMC_PEERCLOSEWAIT1)
+                       do_shutdown = false;
                break;
        case SHUT_WR:
                rc = smc_close_shutdown_write(smc);
                /* nothing more to do because peer is not involved */
                break;
        }
-       if (smc->clcsock)
+       if (do_shutdown && smc->clcsock)
                rc1 = kernel_sock_shutdown(smc->clcsock, how);
        /* map sock_shutdown_cmd constants to sk_shutdown value range */
        sk->sk_shutdown |= how + 1;