[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+nzO2H8AizX4lAQ@infradead.org>
Date: Mon, 13 Feb 2023 00:22:19 -0800
From: Christoph Hellwig <hch@...radead.org>
To: David Howells <dhowells@...hat.com>
Cc: Matthew Wilcox <willy@...radead.org>, Jens Axboe <axboe@...nel.dk>,
Al Viro <viro@...iv.linux.org.uk>,
Christoph Hellwig <hch@...radead.org>, Jan Kara <jack@...e.cz>,
Jeff Layton <jlayton@...nel.org>,
David Hildenbrand <david@...hat.com>,
Jason Gunthorpe <jgg@...dia.com>,
Logan Gunthorpe <logang@...tatee.com>,
Hillf Danton <hdanton@...a.com>, linux-fsdevel@...r.kernel.org,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org,
syzbot+a440341a59e3b7142895@...kaller.appspotmail.com,
Christoph Hellwig <hch@....de>,
John Hubbard <jhubbard@...dia.com>
Subject: Re: [PATCH v14 01/12] splice: Fix O_DIRECT file read splice to avoid
reversion of ITER_PIPE
> + if (!bv)
> + return -ENOMEM;
> +
> + pages = (void *)(bv + npages);
I think this cast should be to struct page **… not void *.
> + npages = alloc_pages_bulk_array(GFP_USER, npages, pages);
> + if (!npages) {
> + kfree(bv);
> + return -ENOMEM;
> + }
> + reclaim = npages * PAGE_SIZE;
> + remain = 0;
> + if (ret > 0) {
> + reclaim -= ret;
> + remain = ret;
...
> + /* Free any pages that didn't get touched at all. */
> + reclaim /= PAGE_SIZE;
Any reason not to keep reclaim in PAGE_SIZE units to start with?
Powered by blists - more mailing lists