* [PATCH] aoe: flush: fix device name string comparison
@ 2025-06-24 12:55 Valentin Kleibel
0 siblings, 0 replies; only message in thread
From: Valentin Kleibel @ 2025-06-24 12:55 UTC (permalink / raw)
To: linux-kernel, linux-block, Jens Axboe, Justin Sanders, Justin Sanders
Cc: ed.cashin
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.
Signed-off-by: Valentin Kleibel <valentin@vrvis.at>
---
drivers/block/aoe/aoedev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
index 3a240755045b..c9d4b9339a20 100644
--- a/drivers/block/aoe/aoedev.c
+++ b/drivers/block/aoe/aoedev.c
@@ -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);
}
--
2.39.5
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-06-24 12:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-24 12:55 [PATCH] aoe: flush: fix device name string comparison Valentin Kleibel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®