Skip to contentSkip to conversation

cluster/cman/qdisk disk.c main.c

Cluster-devel [email protected] 1 participant 1 message Dec 4, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL4
Changes by: lhh at sourceware.org 2007-12-04 21:06:59

Modified files:
cman/qdisk : disk.c main.c

Log message:
Remove artificial label size limit

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/qdisk/disk.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.5&r2=1.1.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/qdisk/main.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.9&r2=1.1.2.10

cman/qdisk/disk.c +3 -5
@@ -225,13 +225,11 @@
 	if (disk->d_fd < 0)
 		return disk->d_fd;
 
-	disk->d_blksz = 512;
 	ret = ioctl(disk->d_fd, BLKSSZGET, &ssz);
-	if (ret < 0)
+	if (ret < 0) {
 		perror("qdisk_open: ioctl(BLKSSZGET)");
-	else
-		/* Sorry, no sector sizes >4GB please */
-		disk->d_blksz = (uint32_t)ssz;
+		return -1;
+	}
 
 	disk->d_pagesz = sysconf(_SC_PAGESIZE);
 
cman/qdisk/main.c +1 -15
@@ -470,20 +470,6 @@
 		return -1;
 	}
 
-	if (strlen(ctx->qc_device) > 15 && !(ctx->qc_flags & RF_CMAN_LABEL)) {
-		if (ctx->qc_label && strlen(ctx->qc_label) <= 15) {
-			ctx->qc_cman_label = strdup(ctx->qc_label);
-		} else {
-			snprintf(buf, sizeof(buf), "QDisk[%d]",
-			 	strlen(ctx->qc_device));
-			ctx->qc_cman_label = strdup(buf);
-		}
-
-		ctx->qc_flags |= RF_CMAN_LABEL;
-		clulog(LOG_DEBUG, "Device too long! Setting CMAN label to: %s\n",
-			ctx->qc_cman_label);
-	}
-
 	clulog(LOG_DEBUG, "I/O Size: %d  Page Size: %d\n",
 	       ctx->qc_disk.d_blksz, ctx->qc_disk.d_pagesz);
 	
@@ -1323,7 +1309,7 @@
 	/* Get cman_label */
 	snprintf(query, sizeof(query), "/cluster/quorumd/@cman_label");
 	if (ccs_get(ccsfd, query, &val) == 0) {
-		if (strlen(val) > 0 && strlen(val) <= 15) {
+		if (strlen(val) > 0) {
 			ctx->qc_flags |= RF_CMAN_LABEL;
 			ctx->qc_cman_label = val;
 		}