WSL2-Linux-Kernel/Documentation/filesystems
Eric Biggers 56124d6c87 fsverity: support enabling with tree block size < PAGE_SIZE
Make FS_IOC_ENABLE_VERITY support values of
fsverity_enable_arg::block_size other than PAGE_SIZE.

To make this possible, rework build_merkle_tree(), which was reading
data and hash pages from the file and assuming that they were the same
thing as "blocks".

For reading the data blocks, just replace the direct pagecache access
with __kernel_read(), to naturally read one block at a time.

(A disadvantage of the above is that we lose the two optimizations of
hashing the pagecache pages in-place and forcing the maximum readahead.
That shouldn't be very important, though.)

The hash block reads are a bit more difficult to handle, as the only way
to do them is through fsverity_operations::read_merkle_tree_page().

Instead, let's switch to the single-pass tree construction algorithm
that fsverity-utils uses.  This eliminates the need to read back any
hash blocks while the tree is being built, at the small cost of an extra
block-sized memory buffer per Merkle tree level.  This is probably what
I should have done originally.

Taken together, the above two changes result in page-size independent
code that is also a bit simpler than what we had before.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Andrey Albershteyn <aalbersh@redhat.com>
Tested-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Link: https://lore.kernel.org/r/20221223203638.41293-8-ebiggers@kernel.org
2023-01-09 19:06:06 -08:00
..
caching
cifs
ext4
nfs
spufs
9p.rst
adfs.rst
affs.rst
afs.rst
api-summary.rst
autofs-mount-control.rst
autofs.rst
automount-support.rst
befs.rst
bfs.rst
btrfs.rst
ceph.rst
coda.rst
configfs.rst configfs: remove mentions of committable items 2022-12-02 11:11:27 +01:00
cramfs.rst
dax.rst
debugfs.rst debugfs: small Documentation cleaning 2022-11-09 13:58:55 -07:00
devpts.rst
directory-locking.rst
dlmfs.rst
dnotify.rst
ecryptfs.rst
efivarfs.rst
erofs.rst erofs: enable large folios for fscache mode 2022-12-07 10:56:31 +08:00
ext2.rst
ext3.rst
f2fs.rst f2fs: add block_age-based extent cache 2022-12-12 14:53:56 -08:00
fiemap.rst
files.rst
fscrypt.rst fscrypt: add additional documentation for SM4 support 2022-12-02 10:43:00 -08:00
fsverity.rst fsverity: support enabling with tree block size < PAGE_SIZE 2023-01-09 19:06:06 -08:00
fuse-io.rst
fuse.rst
gfs2-glocks.rst
gfs2-uevents.rst
gfs2.rst
hfs.rst
hfsplus.rst
hpfs.rst
idmappings.rst
index.rst
inotify.rst
isofs.rst
journalling.rst
locking.rst fs: add new get acl method 2022-10-20 10:13:27 +02:00
locks.rst
mount_api.rst A large number of cleanups and bug fixes, with many of the bug fixes 2022-12-12 19:56:37 -08:00
netfs_library.rst
nilfs2.rst
ntfs.rst
ntfs3.rst fs/ntfs3: Document system.ntfs_attrib_be extended attribute 2022-11-12 20:59:45 +03:00
ocfs2-online-filecheck.rst
ocfs2.rst
omfs.rst
orangefs.rst
overlayfs.rst
path-lookup.rst
path-lookup.txt
porting.rst fs: rename current get acl method 2022-10-20 10:13:27 +02:00
proc.rst MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
qnx6.rst
quota.rst
ramfs-rootfs-initramfs.rst
relay.rst
romfs.rst
seq_file.rst
sharedsubtree.rst
splice.rst
squashfs.rst
sysfs.rst sysfs: update Documentation 2022-11-09 13:57:59 -07:00
sysv-fs.rst
tmpfs.rst
ubifs-authentication.rst
ubifs.rst
udf.rst
vfat.rst
vfs.rst fs: add new get acl method 2022-10-20 10:13:27 +02:00
virtiofs.rst
xfs-delayed-logging-design.rst
xfs-self-describing-metadata.rst
zonefs.rst