On Fri, Jun 21, 2019 at 02:28:25PM -0500, Goldwyn Rodrigues wrote:
> From: Goldwyn Rodrigues <rgoldwyn@xxxxxxxx>
>
> btrfs uses page->private as well to store extent_buffer. Make
> the check stricter to make sure we are using page->private for iop by
> comparing iblocksize < PAGE_SIZE.
>
> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@xxxxxxxx>
/me wonders what will happen when btrfs decides to support blocksize !=
pagesize... will we have to add a pointer to struct iomap_page so that
btrfs can continue to associate an extent_buffer with a page?
--D
> ---
> include/linux/iomap.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/iomap.h b/include/linux/iomap.h
> index f49767c7fd83..6511124e58b6 100644
> --- a/include/linux/iomap.h
> +++ b/include/linux/iomap.h
> @@ -128,7 +128,8 @@ struct iomap_page {
>
> static inline struct iomap_page *to_iomap_page(struct page *page)
> {
> - if (page_has_private(page))
> + if (i_blocksize(page->mapping->host) < PAGE_SIZE &&
> + page_has_private(page))
> return (struct iomap_page *)page_private(page);
> return NULL;
> }
> --
> 2.16.4
>