Subject: Re: linux-next: build failure after merge of the mm tree

From: Jan Kara <[email-masked]>
Date: Fri, 27 Jan 2023 14:11:42 +0100

On Fri 27-01-23 16:59:12, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the mm tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
> 
> fs/udf/inode.c: In function 'udf_writepages':
> fs/udf/inode.c:211:48: error: passing argument 3 of 'write_cache_pages' from incompatible pointer type [-Werror=incompatible-pointer-types]
>   211 |         return write_cache_pages(mapping, wbc, udf_adinicb_writepage, NULL);
>       |                                                ^~~~~~~~~~~~~~~~~~~~~
>       |                                                |
>       |                                                int (*)(struct page *, struct writeback_control *, void *)
> In file included from fs/udf/inode.c:36:
> include/linux/writeback.h:375:66: note: expected 'writepage_t' {aka 'int (*)(struct folio *, struct writeback_control *, void *)'} but argument is of type 'int (*)(struct page *, struct writeback_control *, void *)'
>   375 |                       struct writeback_control *wbc, writepage_t writepage,
>       |                                                      ~~~~~~~~~~~~^~~~~~~~~
> 
> Caused by commit
> 
>   a36a897cc496 ("fs: convert writepage_t callback to pass a folio")
> 
> interacting with commit
> 
>   79d3c6dbada4 ("udf: Convert in-ICB files to use udf_writepages()")
> 
> from the ext3 tree.
> 
> I have applied the following merge fix patch (I wasn't sure what to do
> with the PageLocked()).

Thanks for the fixup! The right function to replace PageLocked() with is
folio_test_locked(). Anyway, I'll prepare a suggested conflict resolution
for Linus when pushing the changes.

								Honza

> 
> From: Stephen Rothwell <[email-masked]>
> Date: Fri, 27 Jan 2023 16:50:34 +1100
> Subject: [PATCH] udf: fix up for "fs: convert writepage_t callback to pass a folio"
> 
> Signed-off-by: Stephen Rothwell <[email-masked]>
> ---
>  fs/udf/inode.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/udf/inode.c b/fs/udf/inode.c
> index 3b2adf4cbc57..b47bf9c73f4d 100644
> --- a/fs/udf/inode.c
> +++ b/fs/udf/inode.c
> @@ -185,16 +185,17 @@ static void udf_write_failed(struct address_space *mapping, loff_t to)
>  	}
>  }
>  
> -static int udf_adinicb_writepage(struct page *page,
> +static int udf_adinicb_writepage(struct folio *folio,
>  				 struct writeback_control *wbc, void *data)
>  {
> +	struct page *page = &folio->page;
>  	struct inode *inode = page->mapping->host;
>  	struct udf_inode_info *iinfo = UDF_I(inode);
>  
> -	BUG_ON(!PageLocked(page));
> +//	BUG_ON(!PageLocked(page));
>  	memcpy_to_page(page, 0, iinfo->i_data + iinfo->i_lenEAttr,
>  		       i_size_read(inode));
> -	unlock_page(page);
> +	folio_unlock(folio);
>  	mark_inode_dirty(inode);
>  
>  	return 0;
> -- 
> 2.35.1
> 
> -- 
> Cheers,
> Stephen Rothwell

-- 
Jan Kara <[email-masked]>
SUSE Labs, CR