From: Krzysztof Wojcik Date: Thu, 6 Jan 2011 05:07:20 +0000 (+1100) Subject: FIX: Position calculation in mdstat_by_subdev X-Git-Tag: mdadm-3.2~141 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6f53092ffb0eea4bd1716cc38ce785b94748e8d;p=thirdparty%2Fmdadm.git FIX: Position calculation in mdstat_by_subdev Signed-off-by: Krzysztof Wojcik Signed-off-by: NeilBrown --- diff --git a/mdstat.c b/mdstat.c index bac37421..3d2edadb 100644 --- a/mdstat.c +++ b/mdstat.c @@ -399,9 +399,9 @@ struct mdstat_ent *mdstat_by_subdev(char *subdev, int container) strncmp(mdstat->metadata_version, "external:", 9) == 0 && strchr("/-", mdstat->metadata_version[9]) != NULL && strncmp(mdstat->metadata_version+10, "md", 2) == 0 && - strtoul(mdstat->metadata_version+11, &pos, 10) + strtoul(mdstat->metadata_version+12, &pos, 10) == (unsigned)container && - pos > mdstat->metadata_version+11 && + pos > mdstat->metadata_version+12 && *pos == '/' && strcmp(pos+1, subdev) == 0 ) {