block: sanitize the elevator name before passing it to __elevator_change
authorChristoph Hellwig <hch@lst.de>
Thu, 20 Oct 2022 06:48:17 +0000 (08:48 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 24 Oct 2022 00:59:17 +0000 (18:59 -0600)
commit58367c8a5f845498fd341e5687bab513925e4ac0
treeadb084cfe60e6cd540516d5bf8670053ebf74800
parentdd6f7f17bf5831ac94d2b8ffe3d67dac201a9b97
block: sanitize the elevator name before passing it to __elevator_change

The stripped name should also be used for the none check.  To do so
strip it in the caller and pass in the sanitized name.  Drop the pointless
__ prefix in the function name while we're at it.

Based on a patch from Jinlong Chen <nickyc975@zju.edu.cn>.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20221020064819.1469928-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/elevator.c