Re: [PATCH 1/1] libblkid: ignore private Stratis devices

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

 



On Mon, Mar 05, 2018 at 12:56:11PM -0600, Tony Asleson wrote:
> +		} else if (strncmp(id, "stratis-", 8) == 0) {
> +			/* Private Stratis devices will be those that start with "stratis-"
> +			 * and that do not match the expected pattern for a thinly
> +			 * provisioned device.
> +			 */
> +			if (!regcomp(&re,
> +						"^stratis-1-[0-9a-f]{32}-thin-fs-[0-9a-f]{32}$",
> +						REG_EXTENDED)) {
> +				if (REG_NOMATCH == regexec(&re, id, 0, NULL, 0))
> +					rc = 1;
> +
> +				regfree(&re);
> +			}

regcomp() ... would be possible to identify the device by any other
way? It would be nice to keep the code simple and stupid.

BTW, why you do not use any special prefix for the private device?

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" 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