Received: by 10.223.185.116 with SMTP id b49csp5479147wrg; Wed, 7 Mar 2018 12:28:56 -0800 (PST) X-Google-Smtp-Source: AG47ELtNtxzx9P+yL6ZgY7Zzl+3D/zgDGt+cAuKlQiQycfzlx3txD3oJulbcd0hZUkU4UqpXswvN X-Received: by 10.99.181.94 with SMTP id u30mr19205909pgo.205.1520454536793; Wed, 07 Mar 2018 12:28:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520454536; cv=none; d=google.com; s=arc-20160816; b=Xq+CMpdDAN/ynkoJKTOyGsdeYK7yETkh5e24frA40NyJnf1NxMcf8FMSisCP3dZUe7 WQ/kND0XwvVefUNIMyfnE7A0fat/yBvVZgAHme1z+kh4p84AxsrQsnilE1SGE5FeP5UT 0coq7fNA6iXfYBVZTaJAywQ4hodQ7hxr820Qn6FblYpFZG+uqGNMDtxvRoRLh7Dax+dT /rhK0T1hj88pwFLPSBGYVbVzUHempdmIu4lsCLbPeAZwsDTPeFrZmqVM6Yrb7XuYXOJC +ZGpXwr9lfvy9Z4PUrcCuI01qar3ldI4JMJyabeeiiikVX55ta/GSWUEkS4D3LWvG+5f WIxg== 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=3cvih4qZRJAwL3qOm0CVHPDy0sTBW7WDwvFG5qnDiiY=; b=nHfK6T2OvJoEVPNhBqfNu/0XyaJ14TMEocijBFLLuxQJmtOsTtH8l9Ky8ZNeoGqZli WGEvOMI+9dDQ1835dRXFwURaAzLhDl+2ko5Kox/Wd4dre/IMxgHPKXl5XuyUszPF1pCX E/4ZgXHVXu44KnCFGp77YpEa6g1l/yXStYW+g2lMczYAGMc6mOAXGI8ZJqoswwkYbi2l KN2lkCVMSA1mqoMoGe2Np0qFB8jioetc47XQLT30IbXarw7OYV7jjxHSb4useaPMZdZG 96BLfj2577gDi3w1cp2GQbMe9fb7AdnTjhyLnETZbjvqppNQCIJ1g7Iq39ofWzMv5YEc MPYg== 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 32-v6si13593992pls.319.2018.03.07.12.28.41; Wed, 07 Mar 2018 12:28:56 -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 S964944AbeCGU1u (ORCPT + 99 others); Wed, 7 Mar 2018 15:27:50 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:42572 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964813AbeCGTm6 (ORCPT ); Wed, 7 Mar 2018 14:42:58 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0299E101E; Wed, 7 Mar 2018 19:42:56 +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.15 091/122] s390/qeth: fix IP removal on offline cards Date: Wed, 7 Mar 2018 11:38:23 -0800 Message-Id: <20180307191742.558338027@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180307191729.190879024@linuxfoundation.org> References: <20180307191729.190879024@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.15-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 @@ -256,12 +256,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); @@ -404,11 +400,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);