[PATCH] blkid: return first detected crypto device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Crypto devices may sometimes have multiple additional prober matches,
however just like RAID, there's no danger of activating the wrong one
since special help is needed to activate the block device before it
can be used.

Thus modify blkid_do_safeprobe() to break out of the loop when a
crypto device is detected, as it does already for RAID.

Signed-off-by: Scott James Remnant <scott@xxxxxxxxxx>
---
 shlibs/blkid/src/probe.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/shlibs/blkid/src/probe.c b/shlibs/blkid/src/probe.c
index 10fcb00..53ddbe8 100644
--- a/shlibs/blkid/src/probe.c
+++ b/shlibs/blkid/src/probe.c
@@ -538,9 +538,9 @@ int blkid_do_probe(blkid_probe pr)
  * (cannot be used in while()) and checks for ambivalen results (more
  * filesystems on the device) -- in such case returns -2.
  *
- * The function does not check for filesystems when a RAID signature is
- * detected.  The function also does not check for collision between RAIDs. The
- * first detected RAID is returned.
+ * The function does not check for filesystems when a RAID or crypto signature
+ * is detected.  The function also does not check for collision between RAIDs
+ * and crypto devices. The first detected RAID or crypto device is returned.
  */
 int blkid_do_safeprobe(blkid_probe pr)
 {
@@ -558,7 +558,7 @@ int blkid_do_safeprobe(blkid_probe pr)
 		}
 		count++;
 
-		if (idinfos[pr->idx]->usage & BLKID_USAGE_RAID)
+		if (idinfos[pr->idx]->usage & (BLKID_USAGE_RAID | BLKID_USAGE_CRYPTO))
 			break;
 		if (!(idinfos[pr->idx]->flags & BLKID_IDINFO_TOLERANT))
 			intol++;
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux