Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1515485ybi; Sat, 27 Jul 2019 11:27:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJwIFC/DJD9TEJPGd6NZBhGqbaQ+c2UrnfKlrXgryS5KajVk5INqhjsXlrK2KJJxhVKPnj X-Received: by 2002:a62:2a4d:: with SMTP id q74mr28510805pfq.86.1564252052023; Sat, 27 Jul 2019 11:27:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564252052; cv=none; d=google.com; s=arc-20160816; b=fd2K4RKcTZvG2b3idt7pAjjDgLun/oaW0fgvGVVpo2P93Hi0A62Zs0NM6pybVRBOua AOxQTE5gFfRuDpOvIz1NtrJng8Qiwi1AMUgUE2RH+RLakZxAUU9Gl8WNiyYmdb2AnH0q j7D3quKk1c7be7TmS3HrR0SFV0LMj1Hsd/QgrxrwJJayWzEV5XRMvc/L4k9E2H8ooBSQ E2oCGa646fmM/K0l+/poROM64hurEPx1StTAq/HM2b7UC4sIYkKgSgUnsAoett1u1S67 A+WtDOB7M4NJfmAUVUlbGqUH4L9WSoBxTXpfqvZhK5Vm0VdCal6MXp35hpPfc+Khkdet xK7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0/WFTXFh8VdFeha4sOv1sy8hRLL0ZORE8CbLTzAFxDU=; b=y2NbulQMyZbShdTjSjk7GX8UPBeB3ZHdHyVqVQcrY+1+yzKZ34fKHqnK5lMV3wThKy 7Bs4/mzD/pFAuijNwXo2e4nsuF+0+kgwadHhIUSmAE7MHokFPD32GtMI+0e5pFo/Yi2Z jhB97+hAjplrpWpc0bH+Ni+KbuCqKnv+Ry7TWolbw1UHy6BCUAWvzK8ksberHkEMW8s1 Rivc0+d2Ze0iayDfrdHRV/7IKps3I5A2mDfck5SD79jV2uGo26+WwxiXMu9DQwV0h9Wu 21Z1hr0OxPAuVtmaTit0nfImgU3bagM9+cgTL16gqzuXVlyvgQU4ihgkov7U0F1lcNLk R79g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="jM5kJK/Q"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r8si19333879pjd.64.2019.07.27.11.27.17; Sat, 27 Jul 2019 11:27:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="jM5kJK/Q"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388081AbfG0S0k (ORCPT + 99 others); Sat, 27 Jul 2019 14:26:40 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:38633 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388044AbfG0S0j (ORCPT ); Sat, 27 Jul 2019 14:26:39 -0400 Received: by mail-pg1-f193.google.com with SMTP id f5so17433895pgu.5; Sat, 27 Jul 2019 11:26:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0/WFTXFh8VdFeha4sOv1sy8hRLL0ZORE8CbLTzAFxDU=; b=jM5kJK/QG896IzPX8gLWoIbGB1GZb4bGfTFin1fzKFOk4db0gRJwIe1CP5hvXFVGgz JN+iZkM/AstYm00x0Y6l2ey4CN3v1VD285jZ4leXt6IiT+54qApHgq0UaSffo3Fr6Gz6 WJ5VsVEtmhv4fRe0LgiHx1nnTBlEc95P5H7XMG3fqA/R2o5STmfP8sqe2IoZiRuIz0fr xOpIJ3YzycIftBxYSto+u5ZFyZ2bdTrxcS2IDiQpzazSGzSgeizQgG4r2h/RJkVW4r2w Hf4B6p2vV6cmdAfMIKIKkGG2bL1bn2HxJu2mvyGVyjOwIG6WnB3l9uj3AMjXM5mQ5sEu 6asQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0/WFTXFh8VdFeha4sOv1sy8hRLL0ZORE8CbLTzAFxDU=; b=KgDVUPJSNFKi6G5iDa8NQ8+k8IU0DsVFdGY0C6iH+zGVqKHiJ2h/ul/MqK8uAYSJjR rRwowqvc0qF+odhjA698jfowplrJqPh0nORoqVA6IVNLH78GpfA/Nju9/v6SYx/bgyaR Za1NotlA8WMJ5klPNBfyLK5zIws7dAOOfuwubnuFajHg2q//ux9NUZkZQi1aZcg2aKui jNhfchBOT2XL+8DYEh9gGrNzpbZpOXlCq7lYRv5qwTFdFW1lYCYTkpodPjok/9QlamZp DAYBuRaogANFasmFoG0NUo5F8EdFqtfod0cuzJxXS1NW7nHzell4eQw9nHJrOLSROVSo ujGw== X-Gm-Message-State: APjAAAUR/lodS6KUmMyGkPEiKhhRCGZil1zDl6JooHlsTzil4TbB1WVd OzE9V2r74umsxRTYkuSXX5oo8HctNE4= X-Received: by 2002:a63:d741:: with SMTP id w1mr22068419pgi.155.1564251998108; Sat, 27 Jul 2019 11:26:38 -0700 (PDT) Received: from localhost.localdomain ([123.213.206.190]) by smtp.gmail.com with ESMTPSA id w4sm75161780pfn.144.2019.07.27.11.26.35 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 27 Jul 2019 11:26:37 -0700 (PDT) From: Minwoo Im To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Klaus Birkelund , Minwoo Im , =?UTF-8?q?Matias=20Bj=C3=B8rling?= , =?UTF-8?q?Javier=20Gonz=C3=A1lez?= Subject: [PATCH 2/2] lightnvm: print error when target is not found Date: Sun, 28 Jul 2019 03:26:26 +0900 Message-Id: <20190727182626.27991-3-minwoo.im.dev@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190727182626.27991-1-minwoo.im.dev@gmail.com> References: <20190727182626.27991-1-minwoo.im.dev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Javier González Signed-off-by: Minwoo Im --- 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