Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp866062yba; Wed, 24 Apr 2019 10:52:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPxPEBlO0OepMj1uF0F0f3mRBQA5ay03rHZs/cKLF/FTS8B3FIOzG7uI5S7dH1pEYzmQw9 X-Received: by 2002:a17:902:7e05:: with SMTP id b5mr34771003plm.127.1556128358740; Wed, 24 Apr 2019 10:52:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556128358; cv=none; d=google.com; s=arc-20160816; b=KgSQ4c2tsRx/CJaNnCB36aEGXrjyqXgO7aW3CgEpwPc7TUpPda2EEV9NhA2lSHNqBI zgm8Z3kaOavxx9gNzvx8SsK6/qSTxHugClCr5T62wwJxVDS7J7kx4V9g8SGu757Kqx5f VkXskX6/8byePIrGUge2hW7UQlw/dmROMuOFvaHfWhRmJedjpP62Uyd3D27IWi3A7JJ2 fhguMH2aPngKlqy/20yX4JhgUlK9dIQpdgBRSJdz2o23PqiT/wHNGEJaNop3F2f2m9mg 14ERP9E4c4SqNiME16uhzKImWGBFLVcCSg921EuQ6xrRjcLzYFN8T7aE3zlbKBmdhZ+q ZXCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VrQTzP6i/LLgUq2J/8hjJOvC8Tgb1mji/yw0SmINOcw=; b=EllEPACz9bD2bcXr1qmMUFOeyaacie8LftK8EcvRb5tOsKQt54NkO0i0b1ZHWzfYrJ pIY+II7TBtEaDeT/s9M278vsaEjTtwUiNNs4sj8B68ej+4LX0Igc4QiOunXGc3BajLpA G4sSQcWbpiCXN4oRC3Usv4lQJ2cgYhNRRags/Hn2HKDam0Vhn7vxKRXSznQI3oTa3zAN qcUugB+cz4sGDQvp4EbGnK9rxBKfIUmJ6xBhjs4i3IJS1lwj/Z9/uaag3OGojw68SHyS Ov39kJYdp43eQcpQHeShGSN/t8VtYwsOL6gHgUJ2BNAdlHkWw7MJ8HxBKP9G/tUa4sYG K7bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hY2wS5mL; 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 e1si171736pgk.510.2019.04.24.10.52.23; Wed, 24 Apr 2019 10:52:38 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=hY2wS5mL; 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 S2390443AbfDXR32 (ORCPT + 99 others); Wed, 24 Apr 2019 13:29:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:55704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390411AbfDXR3X (ORCPT ); Wed, 24 Apr 2019 13:29:23 -0400 Received: from localhost (62-193-50-229.as16211.net [62.193.50.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3F18E21904; Wed, 24 Apr 2019 17:29:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556126962; bh=Bj+f6e7aWxeEh/jYabrRzcDu3Hk3uLM9zqT0oc+BO9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hY2wS5mLccsfluubdmtKrIzAR1ngjLjv81VDhqZJMc2uSUYu8qdwGQOaW+51sH+QP cyiPueqBqxuN31eOtNJBRhn0lVRrFako6zLR7WofnhdV5E7yI7FHbzMo0znaSAV3BG qzen6hEuRk6ZRctpdQlp5vDL8al1d+zz9ZhQ154I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jon Maloy , Hoang Le , "David S. Miller" Subject: [PATCH 4.19 10/96] tipc: missing entries in name table of publications Date: Wed, 24 Apr 2019 19:09:15 +0200 Message-Id: <20190424170920.511222827@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190424170919.829037226@linuxfoundation.org> References: <20190424170919.829037226@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hoang Le [ Upstream commit d1841533e54876f152a30ac398a34f47ad6590b1 ] When binding multiple services with specific type 1Ki, 2Ki.., this leads to some entries in the name table of publications missing when listed out via 'tipc name show'. The problem is at identify zero last_type conditional provided via netlink. The first is initial 'type' when starting name table dummping. The second is continuously with zero type (node state service type). Then, lookup function failure to finding node state service type in next iteration. To solve this, adding more conditional to marked as dirty type and lookup correct service type for the next iteration instead of select the first service as initial 'type' zero. Acked-by: Jon Maloy Signed-off-by: Hoang Le Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/tipc/name_table.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/tipc/name_table.c +++ b/net/tipc/name_table.c @@ -908,7 +908,8 @@ static int tipc_nl_service_list(struct n for (; i < TIPC_NAMETBL_SIZE; i++) { head = &tn->nametbl->services[i]; - if (*last_type) { + if (*last_type || + (!i && *last_key && (*last_lower == *last_key))) { service = tipc_service_find(net, *last_type); if (!service) return -EPIPE;