public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: RHEL5 - qdisk: fix device scanning order.
@ 2009-02-12 19:24 Lon Hohberger
0 siblings, 0 replies; only message in thread
From: Lon Hohberger @ 2009-02-12 19:24 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=6436ec784769ec39828edec0a8616d9e5b4152c0
Commit: 6436ec784769ec39828edec0a8616d9e5b4152c0
Parent: d1ce031d18d7609c8b2ef7519992f21f8c3f1892
Author: Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate: Wed Feb 11 10:40:34 2009 +0100
Committer: Lon Hohberger <lhh@redhat.com>
CommitterDate: Thu Feb 12 14:22:53 2009 -0500
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 803d149..1a09d47 100644
--- a/cman/qdisk/scandisk.c
+++ b/cman/qdisk/scandisk.c
@@ -648,18 +648,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 =
@@ -679,7 +670,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]);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-02-12 19:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-12 19:24 cluster: RHEL5 - qdisk: fix device scanning order Lon Hohberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).