Skip to contentSkip to conversation

ndctl, test: fix sector-mode.sh to work with label support

PATCH In review Vishal Verma 2 participants 2 messages May 23, 2018 libnvdimm: non-volatile memory device

lore
Share & tools
lore

Vishal Verma

author maintainer
#0 lore raw

PATCH 1/1 ndctl, test: fix sector-mode.sh to work with label support

The nfit_test.1 grew support for the label DSMs. Fix sector-mode.sh to emulate labelless mode by zeroing the labels at the start, and supplying --no-autolabel to create-namespace commands.

---
 test/sector-mode.sh | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
test/sector-mode.sh +4 -8
index ee364eb..54b16a5 100755
@@ -32,11 +32,7 @@ $NDCTL zero-labels $BUS all
 $NDCTL enable-region $BUS all
 
 $NDCTL disable-region $BUS1 all
-if $NDCTL zero-labels $BUS1 all; then
-	echo "DIMMs on $BUS1 support labels, skip..."
-	$NDCTL enable-region $BUS1 all
-	false
-fi
+$NDCTL zero-labels $BUS1 all
 $NDCTL enable-region $BUS1 all
 
 rc=1
@@ -44,9 +40,9 @@ query=". | sort_by(.size) | reverse | .[0].dev"
 NAMESPACE=$($NDCTL list $BUS1 -N | jq -r "$query")
 REGION=$($NDCTL list -R --namespace=$NAMESPACE | jq -r ".dev")
 echo 0 > /sys/bus/nd/devices/$REGION/read_only
-$NDCTL create-namespace -e $NAMESPACE -m sector -f -l 4K
-$NDCTL create-namespace -e $NAMESPACE -m dax -f -a 4K
-$NDCTL create-namespace -e $NAMESPACE -m sector -f -l 4K
+$NDCTL create-namespace --no-autolabel -e $NAMESPACE -m sector -f -l 4K
+$NDCTL create-namespace --no-autolabel -e $NAMESPACE -m dax -f -a 4K
+$NDCTL create-namespace --no-autolabel -e $NAMESPACE -m sector -f -l 4K
 
 $NDCTL disable-region $BUS all
 $NDCTL disable-region $BUS1 all
Signature · 6 lines
2.17.0

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Vishal Verma

The nfit_test.1 grew support for the label DSMs. Fix sector-mode.sh to emulate labelless mode by zeroing the labels at the start, and supplying --no-autolabel to create-namespace commands.

Looks good to me:

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm