[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZIlc3Z8Sbgd4Vk6o@infradead.org>
Date: Tue, 13 Jun 2023 23:23:25 -0700
From: Christoph Hellwig <hch@...radead.org>
To: David Howells <dhowells@...hat.com>
Cc: Jens Axboe <axboe@...nel.dk>, David Hildenbrand <david@...hat.com>,
kernel test robot <oliver.sang@...el.com>,
Christoph Hellwig <hch@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Al Viro <viro@...iv.linux.org.uk>,
Matthew Wilcox <willy@...radead.org>, Jan Kara <jack@...e.cz>,
Jeff Layton <jlayton@...nel.org>,
Jason Gunthorpe <jgg@...dia.com>,
Logan Gunthorpe <logang@...tatee.com>,
Hillf Danton <hdanton@...a.com>,
Christian Brauner <brauner@...nel.org>,
Lorenzo Stoakes <lstoakes@...il.com>,
linux-fsdevel@...r.kernel.org, linux-block@...r.kernel.org,
linux-mm@...ck.org, oe-lkp@...ts.linux.dev, lkp@...el.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] block: Fix dio_cleanup() to advance the head index
On Tue, Jun 13, 2023 at 10:54:39PM +0100, David Howells wrote:
> --- a/fs/direct-io.c
> +++ b/fs/direct-io.c
> @@ -459,6 +459,7 @@ static inline void dio_cleanup(struct dio *dio, struct dio_submit *sdio)
> if (dio->is_pinned)
> unpin_user_pages(dio->pages + sdio->head,
> sdio->tail - sdio->head);
> + sdio->head = sdio->tail;
So looking at the original patch, it does:
- while (sdio->head < sdio->tail)
- put_page(dio->pages[sdio->head++]);
+ if (dio->is_pinned)
+ unpin_user_pages(dio->pages + sdio->head,
+ sdio->tail - sdio->head);
so yes, we're this looks correct:
Reviewed-by: Christoph Hellwig <hch@....de>
Powered by blists - more mailing lists