linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Cc: David Howells <dhowells@redhat.com>,
	linux-mm@kvack.org, npiggin@gmail.com,
	linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org,
	linuxppc-dev@lists.ozlabs.org, Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [RFC PATCH] fs/hugetlb: Fix UBSAN warning reported on hugetlb
Date: Thu, 8 Sep 2022 17:53:41 +0100	[thread overview]
Message-ID: <YxoeFUW5HFP/3/s1@casper.infradead.org> (raw)
In-Reply-To: <20220908072659.259324-1-aneesh.kumar@linux.ibm.com>

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)

  reply	other threads:[~2022-09-08 16:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08  7:26 [RFC PATCH] fs/hugetlb: Fix UBSAN warning reported on hugetlb Aneesh Kumar K.V
2022-09-08 16:53 ` Matthew Wilcox [this message]
2022-09-08 16:59   ` Aneesh Kumar K V
     [not found]     ` <Y1lJNepa22oMZ3tR@cathedrallabs.org>
2022-10-26 18:11       ` Mike Kravetz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YxoeFUW5HFP/3/s1@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).