cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] cluster/gfs2/mkfs main_jadd.c
@ 2006-07-20 22:54 adas
  0 siblings, 0 replies; 3+ messages in thread
From: adas @ 2006-07-20 22:54 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	adas at sourceware.org	2006-07-20 22:54:26

Modified files:
	gfs2/mkfs      : main_jadd.c 

Log message:
	gfs2 doesn't allow gfs2meta and gfs2 filesystems to run parallely. gfs2_jadd umounts gfs2 and mounts gfs2meta to do its thing. Removed test mode. little-endian to big-endian change on disk-hash.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mkfs/main_jadd.c.diff?cvsroot=cluster&r1=1.6&r2=1.7

--- cluster/gfs2/mkfs/main_jadd.c	2006/07/10 22:51:10	1.6
+++ cluster/gfs2/mkfs/main_jadd.c	2006/07/20 22:54:25	1.7
@@ -115,7 +115,6 @@
 	printf("  -J <MB>           Size of journals\n");
 	printf("  -j <num>          Number of journals\n");
 	printf("  -q                Don't print anything\n");
-	printf("  -T                Test, do everything except update FS\n");
 	printf("  -V                Print program version information, then exit\n");
 }
 
@@ -134,7 +133,7 @@
 	int optchar;
 	
 	while (cont) {
-		optchar = getopt(argc, argv, "c:DhJ:j:qTu:VX");
+		optchar = getopt(argc, argv, "c:DhJ:j:qu:VX");
 		
 		switch (optchar) {
 		case 'c':
@@ -156,9 +155,6 @@
 		case 'q':
 			sdp->quiet = TRUE;
 			break;
-		case 'T':
-			sdp->test = TRUE;
-			break;
 		case 'V':
 			printf("gfs2_jadd %s (built %s %s)\n", GFS2_RELEASE_NAME,
 			       __DATE__, __TIME__);
@@ -197,7 +193,6 @@
 		printf("  jsize = %u\n", sdp->jsize);
 		printf("  journals = %u\n", sdp->md.journals);
 		printf("  quiet = %d\n", sdp->quiet);
-		printf("  test = %d\n", sdp->test);
 		printf("  path = %s\n", sdp->path_name);
 	}
 }
@@ -227,8 +222,6 @@
 	else if (sdp->quiet)
 		return;
 
-	if (sdp->test)
-		printf("Test mode:              on\n");
 	if (sdp->expert)
 		printf("Expert mode:            on\n");
 
@@ -236,8 +229,6 @@
 	printf("Old Journals           %u\n", sdp->orig_journals);
 	printf("New Journals           %u\n", sdp->md.journals);
 
-	if (sdp->test)
-		printf("\nThe filesystem was not modified.\n");
 }
 
 int 
@@ -282,14 +273,14 @@
 		memset(&ir, 0, sizeof(struct gfs2_inum_range));
 		do_write(fd, (void*)&ir, sizeof(struct gfs2_inum_range));
 	}
-
+	
 	close(fd);
 	
 	sprintf(new_name, "inum_range%u", sdp->md.journals);
 	error = rename2system(sdp, "per_node", new_name);
 	if (error < 0 && errno != EEXIST)
 		die("can't rename2system %s (%d): %s\n", 
-		    new_name, error, strerror(errno));
+		new_name, error, strerror(errno));
 }
 
 void 
@@ -477,7 +468,7 @@
 			lh.lh_blkno = x;
 			gfs2_log_header_out(&lh, buf);
 			hash = gfs2_disk_hash(buf, sizeof(struct gfs2_log_header));
-			((struct gfs2_log_header *)buf)->lh_hash = cpu_to_le32(hash);
+			((struct gfs2_log_header *)buf)->lh_hash = cpu_to_be32(hash);
 
 			do_write(fd, buf, sdp->bsize);
 
@@ -563,8 +554,6 @@
 {
 	int ret;
 	/* mount the meta fs */
-	fprintf(stderr, "mount %s %s %s %d\n", sdp->device_name,
-		meta_mount, "gfs2_meta", 0);
 	if (!dir_exists(meta_mount)) {
 		ret = mkdir(meta_mount, 0700);
 		if (ret)
@@ -663,6 +652,11 @@
 	check_for_gfs2(sdp);
 
 	gather_info(sdp);
+	/* umount gfs2 to be able to mount gfs2meta */
+	{
+		close(sdp->path_fd);
+		umount(sdp->path_name);
+	}
 	if (!find_gfs2_meta(sdp))
 		mount_gfs2_meta(sdp);
 	lock_for_admin(sdp);
@@ -681,7 +675,7 @@
 	}
 
 	close(metafs_fd);
-	close(sdp->path_fd);
+	//close(sdp->path_fd);
 
 	cleanup(sdp);
 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Cluster-devel] cluster/gfs2/mkfs main_jadd.c
@ 2006-08-30 18:32 adas
  0 siblings, 0 replies; 3+ messages in thread
From: adas @ 2006-08-30 18:32 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	adas at sourceware.org	2006-08-30 18:32:36

Modified files:
	gfs2/mkfs      : main_jadd.c 

Log message:
	fix for bz 190204. gfs2_jadd uses the gfs2meta filesystem to add journals to an existing gfs2 fs

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mkfs/main_jadd.c.diff?cvsroot=cluster&r1=1.7&r2=1.8

--- cluster/gfs2/mkfs/main_jadd.c	2006/07/20 22:54:25	1.7
+++ cluster/gfs2/mkfs/main_jadd.c	2006/08/30 18:32:36	1.8
@@ -515,7 +515,8 @@
 			   &fspass) != 6)
 			continue;
 		
-		if (strcmp(meta_device, sdp->device_name) != 0)
+		if (strcmp(meta_device, sdp->device_name) != 0
+		    && strcmp(meta_device, sdp->path_name) != 0)
 			continue;
 		
 		metafs_mounted = 1;
@@ -652,11 +653,7 @@
 	check_for_gfs2(sdp);
 
 	gather_info(sdp);
-	/* umount gfs2 to be able to mount gfs2meta */
-	{
-		close(sdp->path_fd);
-		umount(sdp->path_name);
-	}
+
 	if (!find_gfs2_meta(sdp))
 		mount_gfs2_meta(sdp);
 	lock_for_admin(sdp);
@@ -675,7 +672,7 @@
 	}
 
 	close(metafs_fd);
-	//close(sdp->path_fd);
+	close(sdp->path_fd);
 
 	cleanup(sdp);
 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Cluster-devel] cluster/gfs2/mkfs main_jadd.c
@ 2006-09-28 16:23 adas
  0 siblings, 0 replies; 3+ messages in thread
From: adas @ 2006-09-28 16:23 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	adas at sourceware.org	2006-09-28 16:23:57

Modified files:
	gfs2/mkfs      : main_jadd.c 

Log message:
	memory violation

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mkfs/main_jadd.c.diff?cvsroot=cluster&r1=1.8&r2=1.9

--- cluster/gfs2/mkfs/main_jadd.c	2006/08/30 18:32:36	1.8
+++ cluster/gfs2/mkfs/main_jadd.c	2006/09/28 16:23:57	1.9
@@ -373,7 +373,7 @@
 			sdp->device_name, strerror(errno));
 	}
 	do_lseek(fd, 0x10 * 4096);
-	do_read(fd, buf, 4096);
+	do_read(fd, buf, PATH_MAX);
 	gfs2_sb_in(&(sdp->sd_sb), buf);
 	sdp->bsize = sdp->sd_sb.sb_bsize;
 	strcpy(lock_table,sdp->sd_sb.sb_locktable);



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-09-28 16:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-30 18:32 [Cluster-devel] cluster/gfs2/mkfs main_jadd.c adas
  -- strict thread matches above, loose matches on Subject: below --
2006-09-28 16:23 adas
2006-07-20 22:54 adas

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 NNTP newsgroup(s).