Skip to contentSkip to conversation

aoe: flush: fix device name string comparison

PATCH New Valentin Kleibel 1 participant 1 message Jun 24, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 aoe: flush: fix device name string comparison

Only flush a device if device_name exactly matches. Previously all devices starting with the requested string were flushed.

e.g. 'echo e10.1 > /dev/etherd/flush' erroneously flushed devices e10.10, e10.11,... in addition to e10.1 if they existed.

---
 drivers/block/aoe/aoedev.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/block/aoe/aoedev.c +2 -0
index 3a240755045b..c9d4b9339a20 100644
@@ -264,6 +264,8 @@ user_req(char *s, size_t slen, struct aoedev *d)
 	lim -= p - d->gd->disk_name;
 	if (slen < lim)
 		lim = slen;
+	if (p[lim] != '\0')
+		return 0;
  	return !strncmp(s, p, lim);
 }
Signature · 1 line
2.39.5