On 5/5/25 17:26, Christoph Hellwig wrote:
> Always assign ret where the error happens, and jump to out instead
> of multiple loop exit conditions to prepare for changes in the
> __write_node_folio calling convention.
> 
> Signed-off-by: Christoph Hellwig <h...@lst.de>
> ---
>  fs/f2fs/node.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> index ec74eb9982a5..b9d9519c3da4 100644
> --- a/fs/f2fs/node.c
> +++ b/fs/f2fs/node.c
> @@ -1882,17 +1882,17 @@ int f2fs_fsync_node_pages(struct f2fs_sb_info *sbi, 
> struct inode *inode,
>                       if (!folio_clear_dirty_for_io(folio))
>                               goto continue_unlock;
>  
> -                     ret = __write_node_folio(folio, atomic &&
> +                     if (__write_node_folio(folio, atomic &&
>                                               folio == last_folio,
>                                               &submitted, wbc, true,
> -                                             FS_NODE_IO, seq_id);
> -                     if (ret) {
> +                                             FS_NODE_IO, seq_id)) {
>                               folio_unlock(folio);
>                               f2fs_folio_put(last_folio, false);
> -                             break;
> -                     } else if (submitted) {
> -                             nwritten++;
> +                             ret = -EIO;
> +                             goto out;

It missed to call folio_batch_release() here?

Thanks,

>                       }
> +                     if (submitted)
> +                             nwritten++;
>  
>                       if (folio == last_folio) {
>                               f2fs_folio_put(folio, false);
> @@ -1903,10 +1903,10 @@ int f2fs_fsync_node_pages(struct f2fs_sb_info *sbi, 
> struct inode *inode,
>               folio_batch_release(&fbatch);
>               cond_resched();
>  
> -             if (ret || marked)
> +             if (marked)
>                       break;
>       }
> -     if (!ret && atomic && !marked) {
> +     if (atomic && !marked) {
>               f2fs_debug(sbi, "Retry to write fsync mark: ino=%u, idx=%lx",
>                          ino, last_folio->index);
>               folio_lock(last_folio);
> @@ -1918,7 +1918,7 @@ int f2fs_fsync_node_pages(struct f2fs_sb_info *sbi, 
> struct inode *inode,
>  out:
>       if (nwritten)
>               f2fs_submit_merged_write_cond(sbi, NULL, NULL, ino, NODE);
> -     return ret ? -EIO : 0;
> +     return ret;
>  }
>  
>  static int f2fs_match_ino(struct inode *inode, unsigned long ino, void *data)



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to