Checksum verification during a file read #17062
Replies: 1 comment 1 reply
-
ZIO tree is not built all at once the way you describe it, but the idea is right. Since checksum is a part of any block pointer, any read can be verified. The moment you import the pool, you implicitly trust one single block pointer stored in uberblock. After that every new block pointer you use to read something is stored in some other block that you have already verified with checksums from its respective block pointer, etc. So the chain of protection is: Data block -> indirect block(s) -> dnodes block -> dnodes indirect block(s) -> objset -> ... -> meta-objset -> ... -> uberblock. But verification obviously starts from uberblock and goes the opposite way to the data block, since you can not trust any information from a block that is not verified yet. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I was wondering how the checksum is verified during a file read.
Assume a linux user is reading a file from the dataset. If I understand correctly, the zfs will get the target dnode according to the linux vfs inode. And the zio tree will be constructed in the following order:
root zio -> zio read on dnode -> zio read on indirect node(s) -> zio read on file data
If my understanding is correct, is the checksum verification starts from the target file data and goes up to the dnode?
Thanks for your help.
Beta Was this translation helpful? Give feedback.
All reactions