Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fscrypt: pass a byte offset to fscrypt_zeroout_range_inline_crypt

Logical offsets into an inode are usually expressed as bytes in the VFS.
Switch fscrypt_zeroout_range_inline_crypt to that convention.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20260302141922.370070-10-hch@lst.de
Signed-off-by: Eric Biggers <ebiggers@kernel.org>

authored by

Christoph Hellwig and committed by
Eric Biggers
090c5c15 3c7eaa77

+3 -3
+3 -3
fs/crypto/bio.c
··· 70 70 } 71 71 72 72 static int fscrypt_zeroout_range_inline_crypt(const struct inode *inode, 73 - pgoff_t lblk, sector_t sector, 73 + loff_t pos, sector_t sector, 74 74 unsigned int len) 75 75 { 76 76 const unsigned int blockbits = inode->i_blkbits; 77 77 const unsigned int blocks_per_page = 1 << (PAGE_SHIFT - blockbits); 78 - loff_t pos = (loff_t)lblk << blockbits; 79 78 struct fscrypt_zero_done done = { 80 79 .pending = ATOMIC_INIT(1), 81 80 .done = COMPLETION_INITIALIZER_ONSTACK(done.done), ··· 141 142 const unsigned int du_per_page = 1U << du_per_page_bits; 142 143 u64 du_index = (u64)lblk << (inode->i_blkbits - du_bits); 143 144 u64 du_remaining = (u64)len << (inode->i_blkbits - du_bits); 145 + loff_t pos = (loff_t)lblk << inode->i_blkbits; 144 146 sector_t sector = pblk << (inode->i_blkbits - SECTOR_SHIFT); 145 147 struct page *pages[16]; /* write up to 16 pages at a time */ 146 148 unsigned int nr_pages; ··· 154 154 return 0; 155 155 156 156 if (fscrypt_inode_uses_inline_crypto(inode)) 157 - return fscrypt_zeroout_range_inline_crypt(inode, lblk, sector, 157 + return fscrypt_zeroout_range_inline_crypt(inode, pos, sector, 158 158 len); 159 159 160 160 BUILD_BUG_ON(ARRAY_SIZE(pages) > BIO_MAX_VECS);