diff options
author | Sagi Grimberg <sagi@grimberg.me> | 2020-01-26 23:23:28 -0800 |
---|---|---|
committer | Keith Busch <kbusch@kernel.org> | 2020-02-04 03:00:24 +0900 |
commit | b716e6889c95f64ba32af492461f6cc9341f3f05 (patch) | |
tree | f51aff28a48be1f1d92058d57674828f74b539d8 /drivers/nvme/target/io-cmd-file.c | |
parent | 4ac76436a6d07dec1c3c766f234aa787a16e8f65 (diff) | |
download | lwn-b716e6889c95f64ba32af492461f6cc9341f3f05.tar.gz lwn-b716e6889c95f64ba32af492461f6cc9341f3f05.zip |
nvmet: fix dsm failure when payload does not match sgl descriptor
The host is allowed to pass the controller an sgl describing a buffer
that is larger than the dsm payload itself, allow it when executing
dsm.
Reported-by: Dakshaja Uppalapati <dakshaja@chelsio.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>,
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'drivers/nvme/target/io-cmd-file.c')
-rw-r--r-- | drivers/nvme/target/io-cmd-file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/target/io-cmd-file.c b/drivers/nvme/target/io-cmd-file.c index caebfce06605..cd5670b83118 100644 --- a/drivers/nvme/target/io-cmd-file.c +++ b/drivers/nvme/target/io-cmd-file.c @@ -336,7 +336,7 @@ static void nvmet_file_dsm_work(struct work_struct *w) static void nvmet_file_execute_dsm(struct nvmet_req *req) { - if (!nvmet_check_data_len(req, nvmet_dsm_len(req))) + if (!nvmet_check_data_len_lte(req, nvmet_dsm_len(req))) return; INIT_WORK(&req->f.work, nvmet_file_dsm_work); schedule_work(&req->f.work); |