Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Boris Burkov <boris@bur.io>
To: Mark Harmstone <maharmstone@fb.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: fix wrong sizeof in btrfs_do_encoded_write
Date: Tue, 15 Oct 2024 13:57:21 -0700	[thread overview]
Message-ID: <20241015205721.GA1841334@zen.localdomain> (raw)
In-Reply-To: <20241015113736.1006573-1-maharmstone@fb.com>

On Tue, Oct 15, 2024 at 12:37:29PM +0100, Mark Harmstone wrote:
> btrfs_do_encoded_write was converted to use folios in 400b172b8cdc, but
> we're still allocating based on sizeof(struct page *) rather than
> sizeof(struct folio *).
> 
> Signed-off-by: Mark Harmstone <maharmstone@fb.com>
Reviewed-by: Boris Burkov <boris@bur.io>
> ---
>  fs/btrfs/inode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 5618ca02934a..5bffc2c77718 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -9495,7 +9495,7 @@ ssize_t btrfs_do_encoded_write(struct kiocb *iocb, struct iov_iter *from,
>  	 */
>  	disk_num_bytes = ALIGN(orig_count, fs_info->sectorsize);
>  	nr_folios = DIV_ROUND_UP(disk_num_bytes, PAGE_SIZE);
> -	folios = kvcalloc(nr_folios, sizeof(struct page *), GFP_KERNEL_ACCOUNT);
> +	folios = kvcalloc(nr_folios, sizeof(struct folio *), GFP_KERNEL_ACCOUNT);
>  	if (!folios)
>  		return -ENOMEM;
>  	for (i = 0; i < nr_folios; i++) {
> -- 
> 2.44.2
> 

  reply	other threads:[~2024-10-15 20:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-15 11:37 [PATCH] btrfs: fix wrong sizeof in btrfs_do_encoded_write Mark Harmstone
2024-10-15 20:57 ` Boris Burkov [this message]
2024-10-16  0:27 ` David Sterba

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=20241015205721.GA1841334@zen.localdomain \
    --to=boris@bur.io \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=maharmstone@fb.com \
    /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