Re: [PATCH v2] iomap: get/put the page in iomap_page_create/release()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The V2 fixes look good to me.

    William Kucharski

> On Nov 15, 2018, at 11:41 AM, p.jaroszynski@xxxxxxxxx wrote:
> 
> Fixes: 82cb14175e7d ("xfs: add support for sub-pagesize writeback without buffer_heads")
> Signed-off-by: Piotr Jaroszynski <pjaroszynski@xxxxxxxxxx>
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>
> ---
> fs/iomap.c | 7 +++++++
> 1 file changed, 7 insertions(+)
> 
> diff --git a/fs/iomap.c b/fs/iomap.c
> index 90c2febc93ac..7c369faea1dc 100644
> --- a/fs/iomap.c
> +++ b/fs/iomap.c
> @@ -117,6 +117,12 @@ iomap_page_create(struct inode *inode, struct page *page)
> 	atomic_set(&iop->read_count, 0);
> 	atomic_set(&iop->write_count, 0);
> 	bitmap_zero(iop->uptodate, PAGE_SIZE / SECTOR_SIZE);
> +
> +	/*
> +	 * migrate_page_move_mapping() assumes that pages with private data have
> +	 * their count elevated by 1.
> +	 */
> +	get_page(page);
> 	set_page_private(page, (unsigned long)iop);
> 	SetPagePrivate(page);
> 	return iop;
> @@ -133,6 +139,7 @@ iomap_page_release(struct page *page)
> 	WARN_ON_ONCE(atomic_read(&iop->write_count));
> 	ClearPagePrivate(page);
> 	set_page_private(page, 0);
> +	put_page(page);
> 	kfree(iop);
> }
> 
> -- 
> 2.11.0.262.g4b0a5b2.dirty
> 





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux