linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Christoph Hellwig <hch@lst.de>, Jaegeuk Kim <jaegeuk@kernel.org>
Cc: chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] f2fs: simplify return value handling in f2fs_fsync_node_pages
Date: Wed, 7 May 2025 15:19:57 +0800	[thread overview]
Message-ID: <8460a749-951c-44d8-a5fa-699eb7f902ca@kernel.org> (raw)
In-Reply-To: <20250505092613.3451524-4-hch@lst.de>

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 <hch@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)


  reply	other threads:[~2025-05-07  7:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-05  9:25 cleanup AOP_WRITEPAGE_ACTIVATE use in f2fs Christoph Hellwig
2025-05-05  9:25 ` [PATCH 1/4] f2fs: return bool from __f2fs_write_meta_folio Christoph Hellwig
2025-05-07  6:22   ` Chao Yu
2025-05-08 16:30   ` [f2fs-dev] " patchwork-bot+f2fs
2025-05-05  9:25 ` [PATCH 2/4] f2fs: don't return AOP_WRITEPAGE_ACTIVATE from f2fs_write_single_data_page Christoph Hellwig
2025-05-07  6:28   ` Chao Yu
2025-05-07  6:44     ` Christoph Hellwig
2025-05-07  7:09       ` Chao Yu
2025-05-05  9:26 ` [PATCH 3/4] f2fs: simplify return value handling in f2fs_fsync_node_pages Christoph Hellwig
2025-05-07  7:19   ` Chao Yu [this message]
2025-05-05  9:26 ` [PATCH 4/4] f2f2: return bool from __write_node_folio Christoph Hellwig
2025-05-07  7:29   ` Chao Yu
2025-05-07  7:38 ` cleanup AOP_WRITEPAGE_ACTIVATE use in f2fs Chao Yu
2025-05-07  7:48   ` Christoph Hellwig
2025-05-07  8:13     ` Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8460a749-951c-44d8-a5fa-699eb7f902ca@kernel.org \
    --to=chao@kernel.org \
    --cc=hch@lst.de \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).