Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A6FDC282CE for ; Wed, 24 Apr 2019 17:33:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 321822077C for ; Wed, 24 Apr 2019 17:33:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556127221; bh=nOwcxOncnM7HeHXbgNoNjs3IjkuUCPOuTlkHPcYMlbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=EiWdcCq3KYbh/RDB6HXuDWUd8O4rbvjYgyXfRVmAUzfHTQZOr7Ch5p06QnrJwgT1L EJvrrsyOaxteB1Rw9HIT0ewGEe+WfvPpBSD++UYOhP68gk9IKjeed/fNwYhOy+jW8P fzk1JHBeYhYFZEoHQ23OLSrC1SjtJzADpYzTWUKo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391538AbfDXRdk (ORCPT ); Wed, 24 Apr 2019 13:33:40 -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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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;