On Fri, Apr 26, 2019 at 10:39:37AM +0800, Ming Lei wrote: > 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 <martin.petersen@xxxxxxxxxx> > Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx> > --- > tests/block/028 | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/tests/block/028 b/tests/block/028 > index 7bee691c0515..a0ab9ff208db 100755 > --- a/tests/block/028 > +++ b/tests/block/028 > @@ -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 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!