From: Valentin Kleibel <valentin@vrvis.at>
To: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
Jens Axboe <axboe@kernel.dk>, Justin Sanders <justin@coraid.com>,
Justin Sanders <jsanders.devel@gmail.com>
Cc: ed.cashin@acm.org
Subject: [PATCH] aoe: flush: fix device name string comparison
Date: Tue, 24 Jun 2025 14:55:58 +0200 [thread overview]
Message-ID: <7915e7a7-cc01-40e3-9807-2488b6b5db92@vrvis.at> (raw)
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
reply other threads:[~2025-06-24 12:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7915e7a7-cc01-40e3-9807-2488b6b5db92@vrvis.at \
--to=valentin@vrvis.at \
--cc=axboe@kernel.dk \
--cc=ed.cashin@acm.org \
--cc=jsanders.devel@gmail.com \
--cc=justin@coraid.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®