Re: [PATCH 001 of 7] md: Support 'external' metadata for md arrays.

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

 



On Fri, 14 Dec 2007 17:26:08 +1100 NeilBrown <[email protected]> wrote:

> +	if (strncmp(buf, "external:", 9) == 0) {
> +		int namelen = len-9;
> +		if (namelen >= sizeof(mddev->metadata_type))
> +			namelen = sizeof(mddev->metadata_type)-1;
> +		strncpy(mddev->metadata_type, buf+9, namelen);
> +		mddev->metadata_type[namelen] = 0;
> +		if (namelen && mddev->metadata_type[namelen-1] == '\n')
> +			mddev->metadata_type[--namelen] = 0;
> +		mddev->persistent = 0;
> +		mddev->external = 1;

size_t would be a more appropriate type for `namelen'.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux