From: Karel Zak <kzak@redhat.com>
To: Tony Asleson <tasleson@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: Clarification on blkid_do_safeprobe
Date: Tue, 27 Mar 2018 18:58:17 +0200 [thread overview]
Message-ID: <20180327165817.k4uhvloqdizdqwcb@ws.net.home> (raw)
In-Reply-To: <851d5595-3f7e-8198-5b23-fde793ec31fd@redhat.com>
On Tue, Mar 27, 2018 at 11:28:17AM -0500, Tony Asleson wrote:
> From looking at the documentation and the code for blkid_do_safeprobe
> it's not totally apparent to me that when the function returns -2
> (ambivalent) that there is any results which may be retrieved by
> utilizing blkid_probe_numof_values and blkid_probe_get_value.
After any error blkid_probe_get_value() behavior is undefined. If need
to rescan the device by blkid_do_probe() get all possible results.
See for example misc-utils/blkid.c:print_udev_ambivalent() where we
compose ID_FS_AMBIVALENT= for udev.
> Any clarification on this would be appreciated. Also, do you only get
> the -2 return if BLKID_SUBLKS_BADCSUM is set?
You can get -2 when there is more valid superblocks detected on the
same device. The flag BLKID_SUBLKS_BADCSUM may help, but it's not
requirement.
All depends on msfs-like tools, if the tool does not wipe the device
before it creates a new filesystem then you will see more superblocks.
It's unusual now, but years ago it was pretty common. For example it
was possible to create LUKS/VFAT and SWAP on the same device. You can
imagine what happen with our encrypted data after swapon.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
prev parent reply other threads:[~2018-03-27 16:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-27 16:28 Clarification on blkid_do_safeprobe Tony Asleson
2018-03-27 16:58 ` Karel Zak [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=20180327165817.k4uhvloqdizdqwcb@ws.net.home \
--to=kzak@redhat.com \
--cc=tasleson@redhat.com \
--cc=util-linux@vger.kernel.org \
/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).