Re: [PATCH] e2fsprogs: detect zoned disks and prevent their raw use

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

 



On Fri, Jun 15, 2018 at 01:56:30PM -0700, Luis R. Rodriguez wrote:
> +static errcode_t is_zoned_disk(const char *path)
> +{
> +	char str[PATH_MAX];
> +	char *devname = basename(path);
> +	FILE *file;
> +	int len;
> +
> +	len = snprintf(str, sizeof(str), "/sys/block/%s/queue/zoned", devname);
> +
> +	/* Indicates truncation */
> +	if (len >= PATH_MAX)
> +		return EXT2_ET_INVALID_ARGUMENT;
> +
> +	file = fopen(str, "r");
> +	if (!file)
> +		return 0;
> +
> +	fclose(file);
> +
> +	return EXT2_ET_ZONE_UNSUPPORTED;
> +}


Seems this needs to be extended to ensure this is host-managed only, will spin
a v2 later.

  Luis



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux