[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [dm-devel] dm-verity: Verification fails but do not see Input/Output Error on read

Hash: SHA512

Hi Mikulas,

I figured out what was happening - but I would need your help to explain these behaviours please :)

Case I - Format the hash device, verify and create the dm-verity target. Then modify data in the underlying data-device using dd. Read back the data from the modified location from the verity-device.

Result: Verify fails but 'NO' I/O error reported when reading back from the location using dd.

Case II - Format the hash device, verify and create the dm-verity target device. Remove the verity target, then modify the data in the data-device using dd. Load the verity target and read-back the data from the verity-device from the modified location.

Result: Verify fails and also get I/O error on reading that location using dd.

My understanding was that the verity-device could be created and mounted and then if the underlying data was corrupted somehow, then a read of invalid data from that corrupted location will return -EIO.


PS: I was following the examples in the verity-compat-test script.
From: Mikulas Patocka [mpatocka redhat com]
Sent: 08 August 2013 18:00
To: device-mapper development; Chaitra Bhat
Cc: Alasdair G Kergon
Subject: Re: [dm-devel] dm-verity: Verification fails but do not see Input/Output Error on read

On Thu, 8 Aug 2013, Chaitra Bhat wrote:

> Hash: SHA512
> Hi Mikulas,
> I get 'Invalid argument' with 'iflag=direct' option when I try to read
> from a verity device using dd.

If you use iflag=direct, block size and offset must be aligned on physical
block size boundary (usually 4k). If they are not aligned, you get invalid
argument error.

> Before I read from the device, I also did 'echo 3 >
> /proc/sys/vm/drop_caches' to make sure caches are dropped.

If the filesystem is mounted, it doesn't drop some buffers (those that are
used by the filesystem). Unmount the filesystem first.

> But as I said before, some locations always fail with I/O error when
> read and others don't.

If you still get misbehavior, even if you bypass the cache with
iflag=direct or with filesystem unmount, create a script that reproduces
it and send it to us.

> Regards,
> Chaitra


This electronic message, including attachments, is intended only for the use of the individual or company named above or to which it is addressed. The information contained in this message shall be considered confidential and proprietary, and may include confidential work product. If you are not the intended recipient, please be aware that any unauthorized use, dissemination, distribution or copying of this message is strictly prohibited. If you have received this email in error, please notify the sender by replying to this message and deleting this email immediately.

Version: PGP Universal 3.2.0 (Build 2599)
Charset: us-ascii


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]