diff options
author | Sagi Grimberg <sagi@grimberg.me> | 2020-01-27 08:23:28 +0100 |
---|---|---|
committer | Keith Busch <kbusch@kernel.org> | 2020-02-03 19:00:24 +0100 |
commit | b716e6889c95f64ba32af492461f6cc9341f3f05 (patch) | |
tree | f51aff28a48be1f1d92058d57674828f74b539d8 /drivers/nvme/target/io-cmd-bdev.c | |
parent | nvmet: Pass lockdep expression to RCU lists (diff) | |
download | linux-b716e6889c95f64ba32af492461f6cc9341f3f05.tar.xz linux-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-bdev.c')
-rw-r--r-- | drivers/nvme/target/io-cmd-bdev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd-bdev.c index b6fca0e421ef..ea0e596be15d 100644 --- a/drivers/nvme/target/io-cmd-bdev.c +++ b/drivers/nvme/target/io-cmd-bdev.c @@ -280,7 +280,7 @@ static void nvmet_bdev_execute_discard(struct nvmet_req *req) static void nvmet_bdev_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; switch (le32_to_cpu(req->cmd->dsm.attributes)) { |