diff options
author | Minwoo Im <minwoo.im.dev@gmail.com> | 2019-09-05 21:04:33 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-09-05 13:17:01 -0600 |
commit | 362cd2b1fad43b7de653b40fe75142a850791ce7 (patch) | |
tree | 4094fd395e12e736ccf10d27b960934e667aa6d5 /drivers/lightnvm | |
parent | 43db059ea4b7e97defe8cc41f1a2221baec43730 (diff) | |
download | linux-rpi-362cd2b1fad43b7de653b40fe75142a850791ce7.tar.gz linux-rpi-362cd2b1fad43b7de653b40fe75142a850791ce7.tar.bz2 linux-rpi-362cd2b1fad43b7de653b40fe75142a850791ce7.zip |
lightnvm: print error when target is not found
If userspace requests target to be removed, nvm_remove_tgt() will
iterate the nvm_devices to find out the given target, but if not
found, then it should print out an error.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Updated output string and patch description.
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm')
-rw-r--r-- | drivers/lightnvm/core.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index f88d4e57cff8..7543e395a2c6 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c @@ -495,8 +495,11 @@ static int nvm_remove_tgt(struct nvm_ioctl_remove *remove) } up_read(&nvm_lock); - if (!t) + if (!t) { + pr_err("failed to remove target %s\n", + remove->tgtname); return 1; + } __nvm_remove_target(t, true); kref_put(&dev->ref, nvm_free); |