mds: support file block size
The new fscrypt feature in the kernel client that is under development needs to be able to prevent the MDS from truncating encrypted data that lies beyond the file's st_size. st_size is still used for keeping track of the size of the file and is passed unmodified to the application. However, the encrypted data may go beyond that up to the block size used by fscrypt (4k I believe).
Introduce a concept of a block size for CephFS files which the MDS uses for the purposes of truncating file data (or for COW in the future). The MDS will always round up to the nearest block size when performing a truncate.
#1 Updated by Jeff Layton 3 months ago
Technically, I think the blocksize can be anything >= 8 bytes or so. Too small or large a block will be cumbersome to work with however. A block that aligns with a (typical) page size of 4k seems like a good compromise.
Also, we probably will only want to round up the truncation point for encrypted inodes. We'll want to leave cleartext inodes intact.