DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Mark Asselstine <mark.asselstine@windriver.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] dpdk-devbind.py: remove module search corner cases
Date: Tue, 02 May 2017 00:01:14 +0200	[thread overview]
Message-ID: <3119012.hFVryfW1nx@xps> (raw)
In-Reply-To: <1493665749-10733-1-git-send-email-mark.asselstine@windriver.com>

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 <mark.asselstine@windriver.com>

Good explanation and good fix.

Applied, thanks and welcome

      reply	other threads:[~2017-05-01 22:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-01 19:09 Mark Asselstine
2017-05-01 22:01 ` Thomas Monjalon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3119012.hFVryfW1nx@xps \
    --to=thomas@monjalon.net \
    --cc=dev@dpdk.org \
    --cc=mark.asselstine@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).