[PATCH 3/4] ubifs: Use a folio in do_truncation()

Zhihao Cheng chengzhihao1 at huawei.com
Thu Jun 8 07:31:24 PDT 2023


在 2023/6/6 1:05, Matthew Wilcox 写道:
> On Mon, Jun 05, 2023 at 05:50:28PM +0100, Matthew Wilcox (Oracle) wrote:
>> Convert from the old page APIs to the new folio APIs which saves
>> a few hidden calls to compound_head().
> 
> Argh.  This fix was supposed to be folded in.
> 
> 
> diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
> index 1b2055d5ec5f..67cf5138ccc4 100644
> --- a/fs/ubifs/file.c
> +++ b/fs/ubifs/file.c
> @@ -1161,7 +1161,7 @@ static int do_truncation(struct ubifs_info *c, struct inode *inode,
>   		struct folio *folio;
>   
>   		folio = filemap_lock_folio(inode->i_mapping, index);
> -		if (folio) {
> +		if (!IS_ERR(folio)) {
>   			if (folio_test_dirty(folio)) {
>   				/*
>   				 * 'ubifs_jnl_truncate()' will try to truncate
> .
> 


Reviewed-by: Zhihao Cheng <chengzhihao1 at huawei.com>



More information about the linux-mtd mailing list