[<prev] [next>] [day] [month] [year] [list]
Message-ID: <7915e7a7-cc01-40e3-9807-2488b6b5db92@vrvis.at>
Date: Tue, 24 Jun 2025 14:55:58 +0200
From: Valentin Kleibel <valentin@...is.at>
To: linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
Jens Axboe <axboe@...nel.dk>, Justin Sanders <justin@...aid.com>,
Justin Sanders <jsanders.devel@...il.com>
Cc: ed.cashin@....org
Subject: [PATCH] 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.
Signed-off-by: Valentin Kleibel <valentin@...is.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
Powered by blists - more mailing lists