Message ID | 20241227033908.2949683-1-zangyangyang1@xiaomi.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [f2fs-dev,V2] f2fs: fix using wrong 'submitted' value in f2fs_write_cache_pages | expand |
On 2024/12/27 11:39, zangyangyang1 wrote: > 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> Reviewed-by: Chao Yu <chao@kernel.org> Thanks,
On 2024/12/27 11:39, zangyangyang1 wrote: > 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> > --- > 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; Tab has been converted to spaces in your patch, can you please check format of this patch? Thanks, > + > /* 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 > > #/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/#
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; + /* we should bypass data pages to proceed the kworker jobs */ if (unlikely(f2fs_cp_error(sbi))) { mapping_set_error(folio->mapping, -EIO);
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> --- V2: Initialize "submitted" in f2fs_write_single_data_page() --- fs/f2fs/data.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.43.2 #/******±¾Óʼþ¼°Æ丽¼þº¬ÓÐСÃ×¹«Ë¾µÄ±£ÃÜÐÅÏ¢£¬½öÏÞÓÚ·¢Ë͸øÉÏÃæµØÖ·ÖÐÁгöµÄ¸öÈË»òȺ×é¡£½ûÖ¹ÈκÎÆäËûÈËÒÔÈκÎÐÎʽʹÓ㨰üÀ¨µ«²»ÏÞÓÚÈ«²¿»ò²¿·ÖµØй¶¡¢¸´ÖÆ¡¢»òÉ¢·¢£©±¾ÓʼþÖеÄÐÅÏ¢¡£Èç¹ûÄú´íÊÕÁ˱¾Óʼþ£¬ÇëÄúÁ¢¼´µç»°»òÓʼþ֪ͨ·¢¼þÈ˲¢É¾³ý±¾Óʼþ£¡ This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/#