Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1170029yba; Wed, 24 Apr 2019 16:39:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqyoagDwFcd0rm4JHQx7AXrhs2if06ik4iN4RYCG+PN62Oz4dVXBxTAkUUiyXCjXUgKfCfIw X-Received: by 2002:a17:902:7b96:: with SMTP id w22mr36590730pll.28.1556149149521; Wed, 24 Apr 2019 16:39:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556149149; cv=none; d=google.com; s=arc-20160816; b=SbHGp9ZX6F0kGuE3Uv5HveIyinJH7u4gITgyK6roNbNzcQmbFNH1hSUJUHdc5yMXHp TbDydJiyu1Qo/qi6tkUoZZQTx6NfZBu4dAFTq7chugmmseupPVmEQfH8sIePs+rGVmT0 +me5HV0aVRxn4HE7WzBbtzOc/+d0+lGVVdegrsX4fxNpb9XShUwVvusuaKaKzNV6er8X nQoic6fR/XtYIlqUHu1JMEgktixvLml333FSQGaNJ6yfWdgkircA6CmIPKIu3UbTj1Ex 9snYxK0lBmAgn4QeyfEaa8baIZLqNAxhaufhavcS3J0QwmJBznNTz5YhKIfe38p5/F2/ OW9w== 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=BY6diTTMl8XeF15oDjlVa54MYNhoO3IgwCPKDiz/RO8=; b=PJchtuH4QyGQDOYMkPZNLR1tittvPg8BBpk6/Ulk8pHQN1CZgzBgyb+4i1/dwI2tpG fB76C4epzvspOlRRs8j8bo9AZ01RVvO8tDd1DR5lA2WU0Y9r8SP+V4edOuMYLigZ9E+v VU3K8qkmUfTsxNNybIZh7xQSxOJbXJ9s+EL5T5lFcnlQqyS0EaeI5rYyXFvI8BzWWGPK N178NlFOCwjndsk7bA3MevG+RW+ieVi6hFJ3SfZkKFBq4M4Ds9f5/jjOJX72fyhCVdHw IbwbxUxyfVH0Nd95+PRJdgGleqv+KnEC59k7mtLjPosHBGjiOK8r7LJGP0+z5ME7AFQ0 lmjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=f40gPlpE; 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 a3si5760719pgm.455.2019.04.24.16.38.54; Wed, 24 Apr 2019 16:39:09 -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=f40gPlpE; 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 S2391552AbfDXRdn (ORCPT + 99 others); Wed, 24 Apr 2019 13:33:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:60690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391136AbfDXRdj (ORCPT ); Wed, 24 Apr 2019 13:33:39 -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 C808B2054F; Wed, 24 Apr 2019 17:33:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556127219; bh=nOwcxOncnM7HeHXbgNoNjs3IjkuUCPOuTlkHPcYMlbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f40gPlpEz5Cki0NYNFbpf6YE/+cYHHq+wZMuxqYRACcLFbxvoBIQcbLs9k2LN9fjd F/C3zm96gbgs1jNqy+kg+RdizK9NceYs5r8uJaNdWeCw+3WucYgEO81DBiYwpe3dCb m9T4x4We9uvmebE71ujyNQpRXBkQtilh3cRkDuXw= 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 5.0 011/115] tipc: missing entries in name table of publications Date: Wed, 24 Apr 2019 19:09:07 +0200 Message-Id: <20190424170925.635639141@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190424170924.797924502@linuxfoundation.org> References: <20190424170924.797924502@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 @@ -909,7 +909,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;