[RFC PATCH] fs/hugetlb: Fix UBSAN warning reported on hugetlb
Matthew Wilcox
willy at infradead.org
Fri Sep 9 02:53:41 AEST 2022
On Thu, Sep 08, 2022 at 12:56:59PM +0530, Aneesh Kumar K.V wrote:
> +++ b/fs/dax.c
> @@ -1304,7 +1304,7 @@ EXPORT_SYMBOL_GPL(dax_zero_range);
> int dax_truncate_page(struct inode *inode, loff_t pos, bool *did_zero,
> const struct iomap_ops *ops)
> {
> - unsigned int blocksize = i_blocksize(inode);
> + size_t blocksize = i_blocksize(inode);
> unsigned int off = pos & (blocksize - 1);
If blocksize is larger than 4GB, then off also needs to be size_t.
> +++ b/fs/iomap/buffered-io.c
> @@ -955,7 +955,7 @@ int
> iomap_truncate_page(struct inode *inode, loff_t pos, bool *did_zero,
> const struct iomap_ops *ops)
> {
> - unsigned int blocksize = i_blocksize(inode);
> + size_t blocksize = i_blocksize(inode);
> unsigned int off = pos & (blocksize - 1);
Ditto.
(maybe there are others; I didn't check closely)
More information about the Linuxppc-dev
mailing list