[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20071225140342.9d0ff789.akpm@linux-foundation.org>
Date: Tue, 25 Dec 2007 14:03:42 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: NeilBrown <neilb@...e.de>
Cc: linux-raid@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 001 of 7] md: Support 'external' metadata for md arrays.
On Fri, 14 Dec 2007 17:26:08 +1100 NeilBrown <neilb@...e.de> 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 majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists