Skip to content

Commit c668da9

Browse files
committed
Merge tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/linux
Pull fscrypt fix from Eric Biggers: "Fix an UBSAN warning that started occurring when the block layer started supporting logical_block_size > PAGE_SIZE" * tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/linux: fscrypt: fix left shift underflow when inode->i_blkbits > PAGE_SHIFT
2 parents c90841d + 1e39da9 commit c668da9

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

fs/crypto/inline_crypt.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,7 @@ static bool bh_get_inode_and_lblk_num(const struct buffer_head *bh,
333333
inode = mapping->host;
334334

335335
*inode_ret = inode;
336-
*lblk_num_ret = ((u64)folio->index << (PAGE_SHIFT - inode->i_blkbits)) +
337-
(bh_offset(bh) >> inode->i_blkbits);
336+
*lblk_num_ret = (folio_pos(folio) + bh_offset(bh)) >> inode->i_blkbits;
338337
return true;
339338
}
340339

0 commit comments

Comments
 (0)