Received: by 10.223.185.116 with SMTP id b49csp5453981wrg; Wed, 7 Mar 2018 12:02:41 -0800 (PST) X-Google-Smtp-Source: AG47ELu0wCnSm9c8UtgLbQJG8EdCxRkuaAA7iXfrAoD7IcbOVNXm0AWj8omgAxg+okXNakQNLfH6 X-Received: by 10.99.170.73 with SMTP id x9mr19107282pgo.393.1520452961016; Wed, 07 Mar 2018 12:02:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520452960; cv=none; d=google.com; s=arc-20160816; b=CCpsdv/iw97y+rUMYJQd1V3L1tSp5eWhSaVIJHt/ShW3D/2krD1jfyD0CMT89eMYe9 b+yU6Q9qLSd9agliA/abxfo6OcRnB1Qrolrml6JURJq7qkjoF28YRbQ4ILNBx2anN89y lrrNI9ecwqhFTk7trMQz8I9DsNx+qVscmJ4qH3vqoTdvWm2v4dk0pKomDrGeV6ZyZNxk Qjwors2r5e/zdm2sO4Cua9psJZqqInIT+utGoPmTbZZTPPCWfmyVh6TjjyCUNRBL4GHx SHhFrbu8X3/aAdAEA1o380xFs20IHuVdyrCrXumT7Gah7xSY2EDnb9/2TvUXCEzuVaf0 tbWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=8bWBQvjfVONqXX4ePa2bWVcgzIvytBmLeG9dVxMkp3U=; b=rIiMezDOmz/ZezrkCeqWOAXO7z6zQoSeAZGBTeHfjdxyB4p9j4rrm/8+4bJay+mDRF dFXPO1T0Kcn+RNTmNB4i2gWKpQlm6+tOsql3CzsL7/EHzE7UFTESZ5zWb57BO6GljyaX ao4K7mIgxDUYMUCMH5jYjX4IbTreBnr3yhVg/ywam3jidlEJLKUxl8zpFNMwLvVQ52wh 2Ew4gXqSUt5wc06dgoVn8jDVVHasGgGKnAAb2lcAgVc1LzQK8+fnelDEm7JqkWl6ynCv WHz2q8wGjoKqL1e0K7YTN3UA4yJms1XDJI+pH00cjiZqfull++7u7wjF+hEG4+BEF2CY wdQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1-v6si13416413plb.73.2018.03.07.12.02.26; Wed, 07 Mar 2018 12:02:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935089AbeCGT6k (ORCPT + 99 others); Wed, 7 Mar 2018 14:58:40 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44874 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965667AbeCGTrG (ORCPT ); Wed, 7 Mar 2018 14:47:06 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8517AF6E; Wed, 7 Mar 2018 19:47:05 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julian Wiedmann , "David S. Miller" Subject: [PATCH 4.14 078/110] s390/qeth: fix IP removal on offline cards Date: Wed, 7 Mar 2018 11:39:01 -0800 Message-Id: <20180307191049.719974800@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180307191039.748351103@linuxfoundation.org> References: <20180307191039.748351103@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Julian Wiedmann [ Upstream commit 98d823ab1fbdcb13abc25b420f9bb71bade42056 ] If the HW is not reachable, then none of the IPs in qeth's internal table has been registered with the HW yet. So when deleting such an IP, there's no need to stage it for deregistration - just drop it from the table. This fixes the "add-delete-add" scenario on an offline card, where the the second "add" merely increments the IP's use count. But as the IP is still set to DISP_ADDR_DELETE from the previous "delete" step, l3_recover_ip() won't register it with the HW when the card goes online. Fixes: 5f78e29ceebf ("qeth: optimize IP handling in rx_mode callback") Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/s390/net/qeth_l3_main.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c @@ -255,12 +255,8 @@ int qeth_l3_delete_ip(struct qeth_card * if (addr->in_progress) return -EINPROGRESS; - if (!qeth_card_hw_is_reachable(card)) { - addr->disp_flag = QETH_DISP_ADDR_DELETE; - return 0; - } - - rc = qeth_l3_deregister_addr_entry(card, addr); + if (qeth_card_hw_is_reachable(card)) + rc = qeth_l3_deregister_addr_entry(card, addr); hash_del(&addr->hnode); kfree(addr); @@ -403,11 +399,7 @@ static void qeth_l3_recover_ip(struct qe spin_lock_bh(&card->ip_lock); hash_for_each_safe(card->ip_htable, i, tmp, addr, hnode) { - if (addr->disp_flag == QETH_DISP_ADDR_DELETE) { - qeth_l3_deregister_addr_entry(card, addr); - hash_del(&addr->hnode); - kfree(addr); - } else if (addr->disp_flag == QETH_DISP_ADDR_ADD) { + if (addr->disp_flag == QETH_DISP_ADDR_ADD) { if (addr->proto == QETH_PROT_IPV4) { addr->in_progress = 1; spin_unlock_bh(&card->ip_lock);