From: Minwoo Im <minwoo.im.dev@gmail.com>
To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Klaus Birkelund" <klaus@birkelund.eu>,
"Minwoo Im" <minwoo.im.dev@gmail.com>,
"Matias Bjørling" <mb@lightnvm.io>,
"Javier González" <javier@javigon.com>
Subject: [PATCH 2/2] lightnvm: print error when target is not found
Date: Sun, 28 Jul 2019 03:26:26 +0900 [thread overview]
Message-ID: <20190727182626.27991-3-minwoo.im.dev@gmail.com> (raw)
In-Reply-To: <20190727182626.27991-1-minwoo.im.dev@gmail.com>
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 the error.
Cc: Matias Bjørling <mb@lightnvm.io>
Cc: Javier González <javier@javigon.com>
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
---
drivers/lightnvm/core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index 4c7b48f72e80..4c89a2420a51 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -494,8 +494,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 not found\n",
+ remove->tgtname);
return 1;
+ }
__nvm_remove_target(t, true);
kref_put(&dev->ref, nvm_free);
--
2.17.1
prev parent reply other threads:[~2019-07-27 18:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-27 18:26 [PATCH 0/2] lightnvm: minor updates for lightnvm core Minwoo Im
2019-07-27 18:26 ` [PATCH 1/2] lightnvm: introduce pr_fmt for the prefix nvm Minwoo Im
2019-08-11 19:43 ` Matias Bjørling
2019-07-27 18:26 ` Minwoo Im [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190727182626.27991-3-minwoo.im.dev@gmail.com \
--to=minwoo.im.dev@gmail.com \
--cc=javier@javigon.com \
--cc=klaus@birkelund.eu \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mb@lightnvm.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).