nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Vishal Verma <vishal.l.verma@intel.com>
To: linux-nvdimm@lists.01.org
Cc: Andreas Hasenack <andreas@canonical.com>
Subject: [ndctl PATCH 2/2] ndctl, monitor: in daemon mode, exit successfully if no DIMMs are found
Date: Thu,  4 Oct 2018 18:00:57 -0600	[thread overview]
Message-ID: <20181005000057.30186-2-vishal.l.verma@intel.com> (raw)
In-Reply-To: <20181005000057.30186-1-vishal.l.verma@intel.com>

When we are running as a daemon, it is preferred to exit successfully
when no DIMMs are found. When running in the foreground, retain an error
return so that the user can be notified that nothing was found to
monitor.

In the longer term, replace this with a libudev uevent monitor that will
look for DIMM addition/removal events, and update the running monitor(s)
if the DIMMs match the active filter spec.

Link: https://bugs.launchpad.net/ubuntu/+source/ndctl/+bug/1781268
Reported-by: Andreas Hasenack <andreas@canonical.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: QI Fuli <qi.fuli@jp.fujitsu.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 ndctl/monitor.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ndctl/monitor.c b/ndctl/monitor.c
index b44f946..7bf2ba7 100644
--- a/ndctl/monitor.c
+++ b/ndctl/monitor.c
@@ -681,8 +681,9 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
 		goto out;
 
 	if (!mfa.num_dimm) {
-		err((struct ndctl_ctx *)ctx, "no dimms to monitor\n");
-		rc = -ENXIO;
+		dbg((struct ndctl_ctx *)ctx, "no dimms to monitor\n");
+		if (!monitor.daemon)
+			rc = -ENXIO;
 		goto out;
 	}
 
-- 
2.17.1

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  reply	other threads:[~2018-10-05  0:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-05  0:00 [ndctl PATCH 1/2] ndctl, monitor: fix the severity of the "daemon started" message Vishal Verma
2018-10-05  0:00 ` Vishal Verma [this message]
2018-10-05  0:05   ` [ndctl PATCH 2/2] ndctl, monitor: in daemon mode, exit successfully if no DIMMs are found Williams, Dan J
2018-10-05  5:15   ` Qi, Fuli
2018-10-05  0:04 ` [ndctl PATCH 1/2] ndctl, monitor: fix the severity of the "daemon started" message Williams, Dan J
2018-10-05  4:08 ` Yasunori Goto
2018-10-05  4:23   ` Dan Williams
2018-10-05  4:59     ` Qi, Fuli
     [not found]       ` <4adb62046776c34d28172a94aa95157774e41644.camel@intel.com>
2018-10-05  6:15         ` Qi, Fuli

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=20181005000057.30186-2-vishal.l.verma@intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=andreas@canonical.com \
    --cc=linux-nvdimm@lists.01.org \
    --subject='Re: [ndctl PATCH 2/2] ndctl, monitor: in daemon mode, exit successfully if no DIMMs are found' \
    /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

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).