From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 95C815942 for ; Tue, 2 May 2017 00:01:16 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 07D122094E; Mon, 1 May 2017 18:01:16 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 01 May 2017 18:01:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=HmxUBTtRm8LBuq2 PhEwu1rMlUG5O4ODLGPPs7YLRRi0=; b=XKxAEL/qzgcvpgMtCU33J6WjsxvzxIA lzNXGR3dZD/IePrgp+tds8GQm8n0WObSW4d/IUcW9JojigMMbbQAu9ilWEmh/yI8 nNwp2yTFgpWNe0LggrmY0UU7o8erpJBlnzbr2G7OyF5/h0PGzUwizPDdQRNyT8HN 77LSeCzGRbsI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=HmxUBTtRm8LBuq2PhEwu1rMlUG5O4ODLGPPs7YLRRi0=; b=eo8GqNn0 2Bp9Ug1YE+uQuS3biJFErcnJTJBK2dKholfPMUk2Dix20WYvtY4ajUcvdeYBvgCJ Hu3qlokV/WMVykSn7EFJb5/hwCmB7VWIZ1SMju6iHICBrNDsI4BXbavM6iPO+lJI CwTjiVzWUZwzibAduN5ACefDPWHdgpO8MmCG8JxWbvzGMRiQ4/QdPUqAxvH8mDwV BGcJBAQCF8DAfvOVlKPH7jfHnghR6R/kKHGGeBCrwUSLdBwjVldS74fUsAzEF231 psWj0dFDJ5HsB8i93pWOY2E6rCVrWbCyNN0XeNPUIidBWbmgusa9A2k2yercnKLf MV2n5tXIaIq+Dw== X-ME-Sender: X-Sasl-enc: 7qYvvr5ITmgXpt77PuqiViQXqMkUF9AV3VBl278cPEyP 1493676075 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id B30687E0A4; Mon, 1 May 2017 18:01:15 -0400 (EDT) From: Thomas Monjalon To: Mark Asselstine Cc: dev@dpdk.org Date: Tue, 02 May 2017 00:01:14 +0200 Message-ID: <3119012.hFVryfW1nx@xps> In-Reply-To: <1493665749-10733-1-git-send-email-mark.asselstine@windriver.com> References: <1493665749-10733-1-git-send-email-mark.asselstine@windriver.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] dpdk-devbind.py: remove module search corner cases X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 22:01:16 -0000 01/05/2017 21:09, Mark Asselstine: > The existing code used to search for module files via modinfo has > several corner cases which can result in it failing where it should be > successful. > > The call to lower() would cause results returned by 'modinfo' to be > forced to lowercase, results which were subsequently passed to > exists() which is case sensitive. This was most likely done to capture > all variants of failure strings modinfo might return > (ie. ERROR/Error/error/...) without thought negative effect to the > later call to exists(). For many this is a nonissue but if the module > path included non-lowercase alpha characters, something which is > easily possible with a non-lowercase kernel-extraversion string, this > would cause an issue. > > We could move the call to lower() to the check for "error" but this > still leaves possible corner cases, for modules or module paths with > 'error' in them. > > Instead we will prevent modinfo's stderr from being used as a "good > value" for path, meaning we either get a valid path from modinfo, or > nothing at all. This removes all corner cases. > > Ultimately these preliminary checks are unnecessary as exists() will > only return True if it is passed a valid path, passing it modinfo's > stderr would fail. In keeping with the original code, however, we do > some preliminary checks, but we are now free of corner cases. > > Signed-off-by: Mark Asselstine Good explanation and good fix. Applied, thanks and welcome