All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: zangyangyang <zangyangyang66@gmail.com>
Cc: zangyangyang1 <zangyangyang1@xiaomi.com>,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH v3] f2fs: fix using wrong 'submitted' value in f2fs_write_cache_pages
Date: Wed, 8 Jan 2025 18:29:01 +0000	[thread overview]
Message-ID: <Z37D7TRFCvqMoX5U@google.com> (raw)
In-Reply-To: <20250106033645.4043618-1-zangyangyang1@xiaomi.com>

On 01/06, zangyangyang wrote:
> From: zangyangyang1 <zangyangyang1@xiaomi.com>
> 
> When f2fs_write_single_data_page fails, f2fs_write_cache_pages
> will use the last 'submitted' value incorrectly, which will cause
> 'nwritten' and 'wbc->nr_to_write' calculation errors
> 
> Signed-off-by: zangyangyang1 <zangyangyang1@xiaomi.com>
> ---
> v3: No logical changes, just format patch
> v2: Initialize "submitted" in f2fs_write_single_data_page()
> ---
>  fs/f2fs/data.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 94f7b084f601..f772fbc7f331 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -2816,6 +2816,9 @@ int f2fs_write_single_data_page(struct folio *folio, int *submitted,
>  
>  	trace_f2fs_writepage(folio, DATA);
>  
> +	if (submitted)
> +		*submitted = 0;

I don't think this is correct, as callers should handle it.

> +
>  	/* we should bypass data pages to proceed the kworker jobs */
>  	if (unlikely(f2fs_cp_error(sbi))) {
>  		mapping_set_error(folio->mapping, -EIO);
> -- 
> 2.43.2


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

  reply	other threads:[~2025-01-08 18:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-06  3:36 [f2fs-dev] [PATCH v3] f2fs: fix using wrong 'submitted' value in f2fs_write_cache_pages zangyangyang
2025-01-08 18:29 ` Jaegeuk Kim via Linux-f2fs-devel [this message]
2025-01-09  2:23   ` 臧阳阳
2025-01-09 10:19     ` Chao Yu via Linux-f2fs-devel
2025-01-09 12:46       ` YangYang Zang

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=Z37D7TRFCvqMoX5U@google.com \
    --to=linux-f2fs-devel@lists.sourceforge.net \
    --cc=jaegeuk@kernel.org \
    --cc=zangyangyang1@xiaomi.com \
    --cc=zangyangyang66@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.