public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: rpeterso@sourceware.org
To: cluster-cvs@sources.redhat.com, cluster-devel@redhat.com
Subject: Cluster Project branch, STABLE2, updated. cluster-2.02.00-22-g318e2b2
Date: Wed, 19 Mar 2008 14:23:00 -0000	[thread overview]
Message-ID: <20080319142332.6229.qmail@sourceware.org> (raw)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=318e2b2b42769a9db2387d5f21c290ef3fc926f9

The branch, STABLE2 has been updated
       via  318e2b2b42769a9db2387d5f21c290ef3fc926f9 (commit)
       via  8be4a9b8cb7531fd9f6cd9457aacbac71787f237 (commit)
      from  ce3caa50bca9ae837f50ab7a5f7602b9a1a1401f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 318e2b2b42769a9db2387d5f21c290ef3fc926f9
Author: Bob Peterson <rpeterso@redhat.com>
Date:   Fri Mar 14 11:09:09 2008 -0500

    Resolves: bz 431945: GFS: gfs-kernel should use device major:minor

commit 8be4a9b8cb7531fd9f6cd9457aacbac71787f237
Author: Bob Peterson <rpeterso@redhat.com>
Date:   Fri Mar 14 11:17:46 2008 -0500

    Resolves: bz 421761: 'gfs_tool lockdump' wrongly says 'unknown
    mountpoint' re HP cciss RAID array

-----------------------------------------------------------------------

Summary of changes:
 gfs-kernel/src/gfs/proc.c |   13 +++++++-
 gfs/gfs_tool/util.c       |   64 +++++++--------------------------------------
 2 files changed, 21 insertions(+), 56 deletions(-)

diff --git a/gfs-kernel/src/gfs/proc.c b/gfs-kernel/src/gfs/proc.c
index c86b4e6..b58181c 100644
--- a/gfs-kernel/src/gfs/proc.c
+++ b/gfs-kernel/src/gfs/proc.c
@@ -27,6 +27,7 @@
 #include "lm.h"
 #include "proc.h"
 #include "super.h"
+#include "diaper.h"
 
 struct list_head gfs_fs_list;
 struct semaphore gfs_fs_lock;
@@ -77,16 +78,21 @@ do_list(char *user_buf, size_t size)
 	struct gfs_sbd *sdp = NULL;
 	unsigned int x;
 	char num[21];
+	char device_id[32];
 	char *buf;
 	int error = 0;
+	struct block_device *bdevice;
 
 	down(&gfs_fs_lock);
 
 	x = 0;
 	for (tmp = gfs_fs_list.next; tmp != &gfs_fs_list; tmp = tmp->next) {
 		sdp = list_entry(tmp, struct gfs_sbd, sd_list);
+		bdevice = gfs_diaper_2real(sdp->sd_vfs->s_bdev);
+		sprintf(device_id, "%u:%u", MAJOR(bdevice->bd_dev),
+			MINOR(bdevice->bd_dev));
 		x += sprintf(num, "%lu", (unsigned long)sdp) +
-			strlen(sdp->sd_vfs->s_id) +
+			strlen(device_id) +
 			strlen(sdp->sd_fsname) + 3;
 	}
 
@@ -105,8 +111,11 @@ do_list(char *user_buf, size_t size)
 	x = 0;
 	for (tmp = gfs_fs_list.next; tmp != &gfs_fs_list; tmp = tmp->next) {
 		sdp = list_entry(tmp, struct gfs_sbd, sd_list);
+		bdevice = gfs_diaper_2real(sdp->sd_vfs->s_bdev);
+		sprintf(device_id, "%u:%u", MAJOR(bdevice->bd_dev),
+			MINOR(bdevice->bd_dev));
 		x += sprintf(buf + x, "%lu %s %s\n",
-			     (unsigned long)sdp, sdp->sd_vfs->s_id, sdp->sd_fsname);
+			     (unsigned long)sdp, device_id, sdp->sd_fsname);
 	}
 
 	if (copy_to_user(user_buf, buf, x))
diff --git a/gfs/gfs_tool/util.c b/gfs/gfs_tool/util.c
index b9a4703..a4c1ab4 100644
--- a/gfs/gfs_tool/util.c
+++ b/gfs/gfs_tool/util.c
@@ -122,52 +122,6 @@ str2lines(char *str)
 }
 
 /**
- * do_basename - Create dm-N style name for the device
- * @device:
- *
- * Returns: Pointer to dm name or basename
- */
-
-static char *
-do_basename(char *device)
-{
-	FILE *file;
-	int found = FALSE;
-	char line[256], major_name[256];
-	unsigned int major_number;
-	struct stat st;
-
-	file = fopen("/proc/devices", "r");
-	if (!file)
-		goto punt;
-
-	while (fgets(line, 256, file)) {
-		if (sscanf(line, "%u %s", &major_number, major_name) != 2)
-			continue;
-		if (strcmp(major_name, "device-mapper") != 0)
-			continue;
-		found = TRUE;
-		break;
-	}
-
-	fclose(file);
-
-	if (!found)
-		goto punt;
-
-	if (stat(device, &st))
-		goto punt;
-	if (major(st.st_rdev) == major_number) {
-		static char realname[16];
-		snprintf(realname, 16, "dm-%u", minor(st.st_rdev));
-		return realname;
-	}
-
- punt:
-	return basename(device);
-}
-
-/**
  * mp2cookie - Find the cookie for a filesystem given its mountpoint
  * @mp:
  * @ioctl_ok: If this is FALSE, it's not acceptable to open() the mountpoint
@@ -181,9 +135,9 @@ mp2cookie(char *mp, int ioctl_ok)
 	char *cookie;
 	char *list, **lines;
 	FILE *file;
-	char line[256], device[256];
-	char *dev = NULL;
+	char line[256], device[256], dev_id[256];
 	unsigned int x;
+	struct stat st;
 
 	cookie = malloc(256);
 	if (!cookie)
@@ -196,6 +150,7 @@ mp2cookie(char *mp, int ioctl_ok)
 		die("can't open /proc/mounts: %s\n",
 		    strerror(errno));
 
+	memset(dev_id, 0, sizeof(dev_id));
 	while (fgets(line, 256, file)) {
 		char path[256], type[256];
 
@@ -206,18 +161,19 @@ mp2cookie(char *mp, int ioctl_ok)
 		if (strcmp(type, "gfs"))
 			die("%s is not a GFS filesystem\n", mp);
 
-		dev = do_basename(device);
-
+		if (stat(device, &st))
+			continue;
+		sprintf(dev_id, "%u:%u", major(st.st_rdev),minor(st.st_rdev));
 		break;
 	}
 
 	fclose(file);
 
 	for (x = 0; *lines[x]; x++) {
-		char s_id[256];
-		sscanf(lines[x], "%s %s", cookie, s_id);
-		if (dev) {
-			if (strcmp(s_id, dev) == 0)
+		char device_id[256];
+		sscanf(lines[x], "%s %s", cookie, device_id);
+		if (dev_id[0]) {
+			if (strcmp(device_id, dev_id) == 0)
 				return cookie;
 		} else {
 			if (strcmp(cookie, mp) == 0)


hooks/post-receive
--
Cluster Project


                 reply	other threads:[~2008-03-19 14:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080319142332.6229.qmail@sourceware.org \
    --to=rpeterso@sourceware.org \
    --cc=cluster-cvs@sources.redhat.com \
    --cc=cluster-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).