From: Minwoo Im Date: Thu, 5 Sep 2019 19:04:33 +0000 (+0200) Subject: lightnvm: print error when target is not found X-Git-Tag: for-5.4/block-2019-09-16~31 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=362cd2b1fad43b7de653b40fe75142a850791ce7;p=linux-2.6-block.git 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 Updated output string and patch description. Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe --- 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);