[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/group/gfs_controld main.c recover.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland sourceware org	2007-04-26 20:01:35

Modified files:
	group/gfs_controld: main.c recover.c 

Log message:
	change some mount error conditions to log_error() instead of log_debug()
	so they appear in syslog.  Also set /proc/self/oom_adj.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/main.c.diff?cvsroot=cluster&r1=1.28&r2=1.29
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/recover.c.diff?cvsroot=cluster&r1=1.28&r2=1.29

--- cluster/group/gfs_controld/main.c	2006/12/20 19:13:13	1.28
+++ cluster/group/gfs_controld/main.c	2007/04/26 19:01:34	1.29
@@ -695,6 +695,18 @@
 	}
 }
 
+void set_oom_adj(int val)
+{
+	FILE *fp;
+
+	fp = fopen("/proc/self/oom_adj", "w");
+	if (!fp)
+		return;
+
+	fprintf(fp, "%i", val);
+	fclose(fp);
+}
+
 void set_scheduler(void)
 {
 	struct sched_param sched_param;
@@ -725,6 +737,7 @@
 		daemonize();
 
 	set_scheduler();
+	set_oom_adj(-16);
 
 	return loop();
 }
--- cluster/group/gfs_controld/recover.c	2006/12/20 19:13:13	1.28
+++ cluster/group/gfs_controld/recover.c	2007/04/26 19:01:34	1.29
@@ -1536,18 +1536,18 @@
 	   fs with the same name (which is an error) */
 
 	if (strcmp(mg->dev, dev)) {
-		log_group(mg, "different fs dev %s with same name", mg->dev);
+		log_error("different fs dev %s with same name", mg->dev);
 		return -EINVAL;
 	}
 
 	if (find_mountpoint(mg, dir)) {
-		log_group(mg, "mount point %s already used", dir);
+		log_error("mount point %s already used", dir);
 		return -EBUSY;
 	}
 
 	/* we only really need to check one of these */
 	if (mg->mount_client || mg->mount_client_fd || !mg->kernel_mount_done) {
-		log_group(mg, "other mount in progress client %d fd %d done %d",
+		log_error("other mount in progress client %d fd %d done %d",
 			  mg->mount_client, mg->mount_client_fd,
 			  mg->kernel_mount_done);
 		return -EBUSY;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]