Message ID | 20180503185050.7559-2-vishal.l.verma@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, May 3, 2018 at 11:50 AM, Vishal Verma <vishal.l.verma@intel.com> wrote: > ndctl_bus_wait_for_scrub_completion() printed the same debug message > irrespective of whether we encountered a failure or not. Add a newe *new > debug message that is printed for failing cases. > > Cc: Dan Williams <dan.j.williams@intel.com> > Signed-off-by: Vishal Verma <vishal.l.verma@intel.com> > --- > ndctl/lib/libndctl.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c > index 2a3ef0c..6733b85 100644 > --- a/ndctl/lib/libndctl.c > +++ b/ndctl/lib/libndctl.c > @@ -1248,7 +1248,11 @@ NDCTL_EXPORT int ndctl_bus_wait_for_scrub_completion(struct ndctl_bus *bus) > } > } > > - dbg(ctx, "bus%d: scrub complete\n", ndctl_bus_get_id(bus)); > + if (rc == 0) > + dbg(ctx, "bus%d: scrub complete\n", ndctl_bus_get_id(bus)); > + else > + dbg(ctx, "bus%d: error waiting for scrub completion: %s\n", > + ndctl_bus_get_id(bus), strerror(-rc)); > if (fd) > close (fd); > return rc; > -- > 2.14.3 > Reviewed-by: Dan Williams <dan.j.williams@intel.com>
diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c index 2a3ef0c..6733b85 100644 --- a/ndctl/lib/libndctl.c +++ b/ndctl/lib/libndctl.c @@ -1248,7 +1248,11 @@ NDCTL_EXPORT int ndctl_bus_wait_for_scrub_completion(struct ndctl_bus *bus) } } - dbg(ctx, "bus%d: scrub complete\n", ndctl_bus_get_id(bus)); + if (rc == 0) + dbg(ctx, "bus%d: scrub complete\n", ndctl_bus_get_id(bus)); + else + dbg(ctx, "bus%d: error waiting for scrub completion: %s\n", + ndctl_bus_get_id(bus), strerror(-rc)); if (fd) close (fd); return rc;
ndctl_bus_wait_for_scrub_completion() printed the same debug message irrespective of whether we encountered a failure or not. Add a newe debug message that is printed for failing cases. Cc: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com> --- ndctl/lib/libndctl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)