[Ocfs2-commits] mfasheh commits r2177 - trunk/fs/ocfs2/cluster

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Apr 26 00:58:16 CDT 2005


Author: mfasheh
Signed-off-by: manish
Date: 2005-04-26 00:58:14 -0500 (Tue, 26 Apr 2005)
New Revision: 2177

Modified:
   trunk/fs/ocfs2/cluster/masklog.c
Log:
* the temp string we were using for input was too short, lengthen it.

* we weren't comparing entire strings, just potentially the 1st parts
  of them - being passed "dlm_domain" for example would catch "dlm"
  before it even got to "dlm_domain"

Signed-off-by: manish



Modified: trunk/fs/ocfs2/cluster/masklog.c
===================================================================
--- trunk/fs/ocfs2/cluster/masklog.c	2005-04-26 03:31:39 UTC (rev 2176)
+++ trunk/fs/ocfs2/cluster/masklog.c	2005-04-26 05:58:14 UTC (rev 2177)
@@ -97,8 +97,8 @@
 			      size_t count, loff_t *pos)
 {
 	char *name;
-	char str[16], *mask, *val;
-	unsigned i;
+	char str[32], *mask, *val;
+	unsigned i, masklen, namelen;
 
 	if (count == 0)
 		return 0;
@@ -122,9 +122,16 @@
 	if (strlen(val) == 0)
 		return -EINVAL;
 
+	masklen = strlen(mask);
+
 	for (i = 0; i < ARRAY_SIZE(mlog_bit_names); i++) {
 		name = mlog_bit_names[i];
-		if (name == NULL || strnicmp(mask, name, strlen(name)))
+
+		namelen = strlen(name);
+
+		if (name == NULL
+		    || namelen != masklen
+		    || strnicmp(mask, name, namelen))
 			continue;
 		break;
 	}



More information about the Ocfs2-commits mailing list