bio-integrity: Restore original iterator on verify stage
authorDmitry Monakhov <dmonakhov@openvz.org>
Thu, 29 Jun 2017 18:31:15 +0000 (11:31 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 3 Jul 2017 22:56:29 +0000 (16:56 -0600)
commit63573e359d052e506d305c263576499f06355985
treed7aa2bcea3e447cce87ab40611e2055a4d628622
parentf9df1cd99ebd82f05e8f5e0aa7e38cb8d3c791d7
bio-integrity: Restore original iterator on verify stage

Currently ->verify_fn not woks at all because at the moment it is called
bio->bi_iter.bi_size == 0, so we do not iterate integrity bvecs at all.

In order to perform verification we need to know original data vector,
with new bvec rewind API this is trivial.

testcase: https://github.com/dmonakhov/xfstests/commit/3c6509eaa83b9c17cd0bc95d73fcdd76e1c54a85

Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
[hch: adopted for new status values]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio-integrity.c