diff options
author | Christoph Hellwig <hch@lst.de> | 2019-03-13 18:55:09 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-03-13 19:57:34 +0100 |
commit | 005c674f705ee308e23b8e4e7047419d12122fde (patch) | |
tree | 6d506ce9e8786efd605ee03b88b42f46c3460b9f /drivers/nvme/target/io-cmd-file.c | |
parent | nvme: add proper write zeroes setup for the multipath device (diff) | |
download | linux-005c674f705ee308e23b8e4e7047419d12122fde.tar.xz linux-005c674f705ee308e23b8e4e7047419d12122fde.zip |
nvmet: ignore EOPNOTSUPP for discard
NVMe DSM is a pure hint, so if the underlying device / file system
does not support discard-like operations we should not fail the
operation but rather return success.
Fixes: 3b031d15995f ("nvmet: add error log support for bdev backend")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Tested-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-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 517522305e5c..3e43212d3c1c 100644 --- a/drivers/nvme/target/io-cmd-file.c +++ b/drivers/nvme/target/io-cmd-file.c @@ -297,7 +297,7 @@ static void nvmet_file_execute_discard(struct nvmet_req *req) } ret = vfs_fallocate(req->ns->file, mode, offset, len); - if (ret) { + if (ret && ret != -EOPNOTSUPP) { req->error_slba = le64_to_cpu(range.slba); status = errno_to_nvme_status(req, ret); break; |