[ndctl,1/2] ndctl/check-namespace: improve error message in absence of a BTT
diff mbox series

Message ID 20190822203635.17926-1-vishal.l.verma@intel.com
State Accepted
Commit 210fe713032a6b8ef16bbc2390cef73b96e23f19
Headers show
Series
  • [ndctl,1/2] ndctl/check-namespace: improve error message in absence of a BTT
Related show

Commit Message

Vishal Verma Aug. 22, 2019, 8:36 p.m. UTC
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(+)

Patch
diff mbox series

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;
 			}
 			/*