Skip to contentSkip to conversation

xfs_repair: fix incorrect return value in namecheck()

PATCH In review Eric Sandeen 3 participants 3 messages Jan 31, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs_repair: fix incorrect return value in namecheck()

Obviously a directory entry with a '/' in the name should return 1, i.e. failure. This was just a dumb thinko.

Fixes 45571fd5885d ("xfs_repair: allow '/' in attribute names")

---

repair/da_util.c +1 -1
index c5e690c..4a258e5 100644
@@ -31,7 +31,7 @@ namecheck(
 
 	for (c = name, i = 0; i < length; i++, c++) {
 		if (isadir && *c == '/')
-			return 0;
+			return 1;
 		if (*c == '\0')
 			return 1;
 	}
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Eric Sandeen

Obviously a directory entry with a '/' in the name should return 1, i.e. failure. This was just a dumb thinko.

Fixes 45571fd5885d ("xfs_repair: allow '/' in attribute names")

Looks ok,

(Sez me who complained about this weeks ago on IRC and then RVBd the broken version so who knows where my brain went lunchtime lol...)

--D

Quoted 16 lines

---

repair/da_util.c +1 -1
index c5e690c..4a258e5 100644
@@ -31,7 +31,7 @@ namecheck(
 
 	for (c = name, i = 0; i < length; i++, c++) {
 		if (isadir && *c == '/')
-			return 0;
+			return 1;
 		if (*c == '\0')
 			return 1;
 	}
Reviewed-by on v1 1/1
#2 lore raw
In reply to Eric Sandeen
Quoted 8 lines · Eric Sandeen

Obviously a directory entry with a '/' in the name should return 1, i.e. failure. This was just a dumb thinko.

Fixes 45571fd5885d ("xfs_repair: allow '/' in attribute names")

---

Makes sense.

Quoted 15 lines
repair/da_util.c +1 -1
index c5e690c..4a258e5 100644
@@ -31,7 +31,7 @@ namecheck(
 
 	for (c = name, i = 0; i < length; i++, c++) {
 		if (isadir && *c == '/')
-			return 0;
+			return 1;
 		if (*c == '\0')
 			return 1;
 	}