cluster: master - qdisk: fix device scanning order.
Fabio M. Di Nitto
fabbione@fedoraproject.org
Wed Feb 11 10:06:00 GMT 2009
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=17a4ac525d433c5359f99e14f889e31bc5a61423
Commit: 17a4ac525d433c5359f99e14f889e31bc5a61423
Parent: 8a4a6df74092e2294786b3d4215a4ee2a23416fd
Author: Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate: Wed Feb 11 10:40:34 2009 +0100
Committer: Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Wed Feb 11 11:05:42 2009 +0100
qdisk: fix device scanning order.
Bug 484956 part 2.
This patch re-arrange the check so that full devices are always scanned
before the underneath partitions.
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
cman/qdisk/scandisk.c | 24 ++++++++++++++----------
1 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/cman/qdisk/scandisk.c b/cman/qdisk/scandisk.c
index e393008..4a0935f 100644
--- a/cman/qdisk/scandisk.c
+++ b/cman/qdisk/scandisk.c
@@ -643,18 +643,9 @@ static int scansysfs(struct devlisthead *devlisthead, char *path, int level)
snprintf(newpath, sizeof(newpath),
"%s/%s", path, namelist[n]->d_name);
- if (!stat(newpath, &sb) && !level) {
- if (S_ISDIR(sb.st_mode))
- if (scansysfs(devlisthead, newpath, 1) < 0)
- return -1;
- } else if (!lstat(newpath, &sb)) {
- if (S_ISDIR(sb.st_mode))
- if (scansysfs(devlisthead, newpath, 1) < 0)
- return -1;
-
+ if (!lstat(newpath, &sb) && level)
if (S_ISLNK(sb.st_mode))
continue;
- }
if (sysfs_is_dev(newpath, &maj, &min) > 0) {
startnode =
@@ -674,7 +665,20 @@ static int scansysfs(struct devlisthead *devlisthead, char *path, int level)
"slaves");
startnode->sysfsattrs.disk =
sysfs_is_disk(newpath);
+
+ printf("Allocated: %s holders: %d\n", newpath, startnode->sysfsattrs.holders);
}
+
+ if (!stat(newpath, &sb) && !level)
+ if (S_ISDIR(sb.st_mode))
+ if (scansysfs(devlisthead, newpath, 1) < 0)
+ return -1;
+
+ if (!lstat(newpath, &sb))
+ if (S_ISDIR(sb.st_mode))
+ if (scansysfs(devlisthead, newpath, 1) < 0)
+ return -1;
+
}
free(namelist[n]);
}
More information about the Cluster-cvs
mailing list