Skip to contentSkip to conversation

block/028: check if T10 verification fails

PATCH In review Ming Lei 5 participants 8 messages Apr 26, 2019 – May 6, 2019

Subsystems (2)
lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH 1/1 block/028: check if T10 verification fails

When T10 verification fails, the error code of BLK_STS_PROTECTION may not be propagated to user space, see mpage_end_io().

So seems the only reliable way for detecting the failure is to check dmesg.

Cc Martin K . Petersen <[email protected]>
---
 tests/block/028 | 8 ++++++++
 1 file changed, 8 insertions(+)
tests/block/028 +8 -0
index 7bee691c0515..a0ab9ff208db 100755
@@ -38,6 +38,14 @@ test() {
 			test_pi "$dix" "$dif"
 			echo "Test(dix:$dix dif:$dif) complete"
 		done
+		if dmesg | grep -q "guard tag error at sector"; then
+			echo "Fail"
+			break
+		fi
+		if dmesg | grep -q "ref tag error at location"; then
+			echo "Fail"
+			break
+		fi
 	done
 
 	rm -f "$FULL"
Signature · 1 line
2.9.5
#1 lore raw
Quoted 2 lines · Ming Lei

When T10 verification fails, the error code of BLK_STS_PROTECTION may not be propagated to user space, see mpage_end_io().

Well, we should probably fix that instead of papering over it..

#2 lore raw

Until we fix this, I'm okay to have this change in the blktest, if this is breaking any exiting behavior.

Quoted 6 lines · Christoph Hellwig
Quoted 2 lines · Ming Lei

When T10 verification fails, the error code of BLK_STS_PROTECTION may not be propagated to user space, see mpage_end_io().

Well, we should probably fix that instead of papering over it..

author
#3 lore raw
Quoted 2 lines · Chaitanya Kulkarni

Until we fix this, I'm okay to have this change in the blktest, if this is breaking any exiting behavior.

This is a patch for enhancing/fixing block/028 test case, so that we can't hide the kernel issue. Now when the issue is triggered, block/028 still shows 'passed'.

It is nothing do with fix in kernel side.

Even though it is fixed upstream, there may be other old kernel releases which needs to expose the issue.

Even it is fixed completely, sometimes regression may come up again.

Thanks,
Ming

author
#4 lore raw
In reply to Christoph Hellwig
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines · Ming Lei

When T10 verification fails, the error code of BLK_STS_PROTECTION may not be propagated to user space, see mpage_end_io().

Well, we should probably fix that instead of papering over it..

That might be a big change, and not sure when they can be fixed completely.

This patch at least can expose the issue to user first.

Anyway, CC filesystem guys.

Thanks,
Ming

#5 lore raw
Quoted 11 lines · Ming Lei
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines · Ming Lei

When T10 verification fails, the error code of BLK_STS_PROTECTION may not be propagated to user space, see mpage_end_io().

Well, we should probably fix that instead of papering over it..

That might be a big change, and not sure when they can be fixed completely.

This patch at least can expose the issue to user first.

I don't see a patch anywhere ... ?

--D

Quoted 4 lines

Anyway, CC filesystem guys.

Thanks,
Ming

author
#6 lore raw
Quoted 6 lines · Darrick J. Wong
Quoted 5 lines · Ming Lei
Quoted 4 lines · Christoph Hellwig
Quoted 2 lines · Ming Lei

When T10 verification fails, the error code of BLK_STS_PROTECTION may not be propagated to user space, see mpage_end_io().

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Well, we should probably fix that instead of papering over it..

That might be a big change, and not sure when they can be fixed completely.

This patch at least can expose the issue to user first.

I don't see a patch anywhere ... ?

It is one blktest patch, please see the following link:

https://lore.kernel.org/linux-block/20190427012449.GC178347@magnolia/T/#t

Thanks,
Ming

#7 lore raw
In reply to Ming Lei
Quoted 18 lines · Ming Lei

When T10 verification fails, the error code of BLK_STS_PROTECTION may not be propagated to user space, see mpage_end_io().

So seems the only reliable way for detecting the failure is to check dmesg.

Cc Martin K . Petersen <[email protected]>
---
 tests/block/028 | 8 ++++++++
 1 file changed, 8 insertions(+)
tests/block/028 +0 -0
index 7bee691c0515..a0ab9ff208db 100755
@@ -38,6 +38,14 @@ test() {
 			test_pi "$dix" "$dif"

tests/block/028 test() { · line 48

Quoted 10 lines
tests/block/028 +8 -0
 			echo "Test(dix:$dix dif:$dif) complete"
 		done
+		if dmesg | grep -q "guard tag error at sector"; then
+			echo "Fail"
+			break
+		fi
+		if dmesg | grep -q "ref tag error at location"; then
+			echo "Fail"
+			break
+		fi

This will also catch messages that didn't occur during the test run. Not a huge deal, but I reworked it to use DMESG_FILTER instead. Thanks!