Skip to content

Commit 362cd2b

Browse files
minwooimaxboe
authored andcommitted
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>
1 parent 43db059 commit 362cd2b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎drivers/lightnvm/core.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,11 @@ static int nvm_remove_tgt(struct nvm_ioctl_remove *remove)
495495
}
496496
up_read(&nvm_lock);
497497

498-
if (!t)
498+
if (!t) {
499+
pr_err("failed to remove target %s\n",
500+
remove->tgtname);
499501
return 1;
502+
}
500503

501504
__nvm_remove_target(t, true);
502505
kref_put(&dev->ref, nvm_free);

0 commit comments

Comments
 (0)