[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZdzRU0sMqFYlNC01@casper.infradead.org>
Date: Mon, 26 Feb 2024 17:58:43 +0000
From: Matthew Wilcox <willy@...radead.org>
To: "Pankaj Raghav (Samsung)" <kernel@...kajraghav.com>
Cc: linux-xfs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, david@...morbit.com,
chandan.babu@...cle.com, akpm@...ux-foundation.org,
mcgrof@...nel.org, ziy@...dia.com, hare@...e.de, djwong@...nel.org,
gost.dev@...sung.com, linux-mm@...ck.org,
Pankaj Raghav <p.raghav@...sung.com>
Subject: Re: [PATCH 10/13] iomap: fix iomap_dio_zero() for fs bs > system
page size
On Mon, Feb 26, 2024 at 10:49:33AM +0100, Pankaj Raghav (Samsung) wrote:
> +++ b/fs/iomap/direct-io.c
> @@ -239,14 +239,23 @@ static void iomap_dio_zero(const struct iomap_iter *iter, struct iomap_dio *dio,
> struct page *page = ZERO_PAGE(0);
> struct bio *bio;
>
> - bio = iomap_dio_alloc_bio(iter, dio, 1, REQ_OP_WRITE | REQ_SYNC | REQ_IDLE);
> + WARN_ON_ONCE(len > (BIO_MAX_VECS * PAGE_SIZE));
> +
> + bio = iomap_dio_alloc_bio(iter, dio, BIO_MAX_VECS,
> + REQ_OP_WRITE | REQ_SYNC | REQ_IDLE);
> fscrypt_set_bio_crypt_ctx(bio, inode, pos >> inode->i_blkbits,
> GFP_KERNEL);
> +
> bio->bi_iter.bi_sector = iomap_sector(&iter->iomap, pos);
> bio->bi_private = dio;
> bio->bi_end_io = iomap_dio_bio_end_io;
>
> - __bio_add_page(bio, page, len, 0);
> + while (len) {
> + unsigned int io_len = min_t(unsigned int, len, PAGE_SIZE);
> +
> + __bio_add_page(bio, page, io_len, 0);
> + len -= io_len;
> + }
I thought we were going to use the huge_zero_page for this?
Powered by blists - more mailing lists