All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Doucha <mdoucha@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] Fix search for device ID in tst_find_backing_dev()
Date: Fri, 25 Sep 2020 12:31:06 +0200	[thread overview]
Message-ID: <88b747e2-1d24-798e-6d71-bfc4cd483208@suse.cz> (raw)
In-Reply-To: <20200925102724.25815-1-mdoucha@suse.cz>

On 25. 09. 20 12:27, Martin Doucha wrote:
> The current search using substrings can lead to false positives, e.g. search
> for device 0:5 could return device 10:50 instead. Parse device IDs in
> /proc/self/mountinfo properly using sscanf() and also check whether the device
> was really found.
> 
> Signed-off-by: Martin Doucha <mdoucha@suse.cz>

I forgot to add an extra comment that I still don't like that the search
uses fixed-size buffer without properly handling lines that are too long
but let's keep the fix simple for now. We can fix long line handling
after the release.

-- 
Martin Doucha   mdoucha@suse.cz
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

  reply	other threads:[~2020-09-25 10:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 10:27 [LTP] [PATCH] Fix search for device ID in tst_find_backing_dev() Martin Doucha
2020-09-25 10:31 ` Martin Doucha [this message]
2020-09-25 13:01 ` Cyril Hrubis

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=88b747e2-1d24-798e-6d71-bfc4cd483208@suse.cz \
    --to=mdoucha@suse.cz \
    --cc=ltp@lists.linux.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.