linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
* [ndctl PATCH 1/2] ndctl/check-namespace: improve error message in absence of a BTT
@ 2019-08-22 20:36 Vishal Verma
  2019-08-22 20:36 ` [ndctl PATCH 2/2] libdaxctl: point to migrate-device-model for dax-class errors Vishal Verma
  0 siblings, 1 reply; 3+ messages in thread
From: Vishal Verma @ 2019-08-22 20:36 UTC (permalink / raw)
  To: linux-nvdimm; +Cc: Scott Davenport

When a BTT info block is not found, check-namespace only reported
something like:

  namespace5.0: namespace_check: Unable to recover any BTT info blocks
  error checking namespaces: No such device or address
  checked 0 namespaces

This can be improved by suggesting a BTT might not have been present on
the namespace at all, so emit an additional message such as:

  namespace5.0: namespace_check: This may not be a sector mode namespace

Link: https://github.com/pmem/ndctl/issues/43
Reported-by: Jane Chu <jane.chu@oracle.com>
Reported-by: Scott Davenport <scott.davenport@oracle.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 ndctl/check.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ndctl/check.c b/ndctl/check.c
index 5969012..365abaf 100644
--- a/ndctl/check.c
+++ b/ndctl/check.c
@@ -1322,6 +1322,8 @@ int namespace_check(struct ndctl_namespace *ndns, bool verbose, bool force,
 			rc = btt_recover_first_sb(bttc);
 			if (rc) {
 				err(bttc, "Unable to recover any BTT info blocks\n");
+				err(bttc,
+					"This may not be a sector mode namespace\n");
 				goto out_close;
 			}
 			/*
-- 
2.20.1

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [ndctl PATCH 2/2] libdaxctl: point to migrate-device-model for dax-class errors
  2019-08-22 20:36 [ndctl PATCH 1/2] ndctl/check-namespace: improve error message in absence of a BTT Vishal Verma
@ 2019-08-22 20:36 ` Vishal Verma
  2019-08-22 20:41   ` Jeff Moyer
  0 siblings, 1 reply; 3+ messages in thread
From: Vishal Verma @ 2019-08-22 20:36 UTC (permalink / raw)
  To: linux-nvdimm; +Cc: Dave Hansen

When a dax-bus vs. dax-class expectation causes a failure, such as when
reconfiguring device modes, print an error message directly pointing the
user to the daxctl-migrate-device-model command.

Reported-by: Dave Hansen <dave.hansen@linux.intel.com>
Reported-by: Jeff Moyer <jmoyer@redhat.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 daxctl/lib/libdaxctl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/daxctl/lib/libdaxctl.c b/daxctl/lib/libdaxctl.c
index 44842b9..c0a859c 100644
--- a/daxctl/lib/libdaxctl.c
+++ b/daxctl/lib/libdaxctl.c
@@ -917,6 +917,7 @@ static int daxctl_dev_enable(struct daxctl_dev *dev, enum daxctl_dev_mode mode)
 
 	if (!device_model_is_dax_bus(dev)) {
 		err(ctx, "%s: error: device model is dax-class\n", devname);
+		err(ctx, "%s: see man daxctl-migrate-device-model\n", devname);
 		return -EOPNOTSUPP;
 	}
 
@@ -962,6 +963,7 @@ DAXCTL_EXPORT int daxctl_dev_disable(struct daxctl_dev *dev)
 
 	if (!device_model_is_dax_bus(dev)) {
 		err(ctx, "%s: error: device model is dax-class\n", devname);
+		err(ctx, "%s: see man daxctl-migrate-device-model\n", devname);
 		return -EOPNOTSUPP;
 	}
 
-- 
2.20.1

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [ndctl PATCH 2/2] libdaxctl: point to migrate-device-model for dax-class errors
  2019-08-22 20:36 ` [ndctl PATCH 2/2] libdaxctl: point to migrate-device-model for dax-class errors Vishal Verma
@ 2019-08-22 20:41   ` Jeff Moyer
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Moyer @ 2019-08-22 20:41 UTC (permalink / raw)
  To: Vishal Verma; +Cc: Dave Hansen, linux-nvdimm

Vishal Verma <vishal.l.verma@intel.com> writes:

> When a dax-bus vs. dax-class expectation causes a failure, such as when
> reconfiguring device modes, print an error message directly pointing the
> user to the daxctl-migrate-device-model command.
>
> Reported-by: Dave Hansen <dave.hansen@linux.intel.com>
> Reported-by: Jeff Moyer <jmoyer@redhat.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> ---
>  daxctl/lib/libdaxctl.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/daxctl/lib/libdaxctl.c b/daxctl/lib/libdaxctl.c
> index 44842b9..c0a859c 100644
> --- a/daxctl/lib/libdaxctl.c
> +++ b/daxctl/lib/libdaxctl.c
> @@ -917,6 +917,7 @@ static int daxctl_dev_enable(struct daxctl_dev *dev, enum daxctl_dev_mode mode)
>  
>  	if (!device_model_is_dax_bus(dev)) {
>  		err(ctx, "%s: error: device model is dax-class\n", devname);
> +		err(ctx, "%s: see man daxctl-migrate-device-model\n", devname);
>  		return -EOPNOTSUPP;
>  	}
>  
> @@ -962,6 +963,7 @@ DAXCTL_EXPORT int daxctl_dev_disable(struct daxctl_dev *dev)
>  
>  	if (!device_model_is_dax_bus(dev)) {
>  		err(ctx, "%s: error: device model is dax-class\n", devname);
> +		err(ctx, "%s: see man daxctl-migrate-device-model\n", devname);
>  		return -EOPNOTSUPP;
>  	}

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-22 20:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-22 20:36 [ndctl PATCH 1/2] ndctl/check-namespace: improve error message in absence of a BTT Vishal Verma
2019-08-22 20:36 ` [ndctl PATCH 2/2] libdaxctl: point to migrate-device-model for dax-class errors Vishal Verma
2019-08-22 20:41   ` Jeff Moyer

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