* [f2fs-dev] [PATCH] f2fs: remove some dead code
@ 2023-04-17 20:51 Christophe JAILLET
2023-04-18 4:43 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Christophe JAILLET @ 2023-04-17 20:51 UTC (permalink / raw)
To: Jaegeuk Kim, Chao Yu
Cc: Christophe JAILLET, kernel-janitors, linux-kernel,
linux-f2fs-devel
'ret' is known to be 0 at the point.
So these lines of code should just be removed.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
The dead code became after commit 8358014d6be8 ("f2fs: avoid to check
PG_error flag")
---
fs/f2fs/node.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index bd1dad523796..e7bc87177e18 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -2063,7 +2063,7 @@ int f2fs_wait_on_node_pages_writeback(struct f2fs_sb_info *sbi,
struct list_head *head = &sbi->fsync_node_list;
unsigned long flags;
unsigned int cur_seq_id = 0;
- int ret2, ret = 0;
+ int ret;
while (seq_id && cur_seq_id < seq_id) {
spin_lock_irqsave(&sbi->fsync_node_lock, flags);
@@ -2084,14 +2084,9 @@ int f2fs_wait_on_node_pages_writeback(struct f2fs_sb_info *sbi,
f2fs_wait_on_page_writeback(page, NODE, true, false);
put_page(page);
-
- if (ret)
- break;
}
- ret2 = filemap_check_errors(NODE_MAPPING(sbi));
- if (!ret)
- ret = ret2;
+ ret = filemap_check_errors(NODE_MAPPING(sbi));
return ret;
}
--
2.34.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: remove some dead code
2023-04-17 20:51 [f2fs-dev] [PATCH] f2fs: remove some dead code Christophe JAILLET
@ 2023-04-18 4:43 ` Dan Carpenter
2023-04-27 16:28 ` Jaegeuk Kim
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2023-04-18 4:43 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Jaegeuk Kim, kernel-janitors, linux-kernel, linux-f2fs-devel
On Mon, Apr 17, 2023 at 10:51:46PM +0200, Christophe JAILLET wrote:
>
> - ret2 = filemap_check_errors(NODE_MAPPING(sbi));
> - if (!ret)
> - ret = ret2;
> + ret = filemap_check_errors(NODE_MAPPING(sbi));
>
> return ret;
Let's get rid of "ret" as well:
return filemap_check_errors(NODE_MAPPING(sbi));
regards,
dan carpenter
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: remove some dead code
2023-04-18 4:43 ` Dan Carpenter
@ 2023-04-27 16:28 ` Jaegeuk Kim
2023-04-28 1:01 ` Chao Yu
0 siblings, 1 reply; 4+ messages in thread
From: Jaegeuk Kim @ 2023-04-27 16:28 UTC (permalink / raw)
To: Dan Carpenter
Cc: kernel-janitors, Christophe JAILLET, linux-kernel,
linux-f2fs-devel
On 04/18, Dan Carpenter wrote:
> On Mon, Apr 17, 2023 at 10:51:46PM +0200, Christophe JAILLET wrote:
> >
> > - ret2 = filemap_check_errors(NODE_MAPPING(sbi));
> > - if (!ret)
> > - ret = ret2;
> > + ret = filemap_check_errors(NODE_MAPPING(sbi));
> >
> > return ret;
>
> Let's get rid of "ret" as well:
>
> return filemap_check_errors(NODE_MAPPING(sbi));
Applied with this modification. Thanks.
>
> regards,
> dan carpenter
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: remove some dead code
2023-04-27 16:28 ` Jaegeuk Kim
@ 2023-04-28 1:01 ` Chao Yu
0 siblings, 0 replies; 4+ messages in thread
From: Chao Yu @ 2023-04-28 1:01 UTC (permalink / raw)
To: Jaegeuk Kim, Dan Carpenter
Cc: kernel-janitors, Christophe JAILLET, linux-kernel,
linux-f2fs-devel
On 2023/4/28 0:28, Jaegeuk Kim wrote:
> On 04/18, Dan Carpenter wrote:
>> On Mon, Apr 17, 2023 at 10:51:46PM +0200, Christophe JAILLET wrote:
>>>
>>> - ret2 = filemap_check_errors(NODE_MAPPING(sbi));
>>> - if (!ret)
>>> - ret = ret2;
>>> + ret = filemap_check_errors(NODE_MAPPING(sbi));
>>>
>>> return ret;
>>
>> Let's get rid of "ret" as well:
>>
>> return filemap_check_errors(NODE_MAPPING(sbi));
>
> Applied with this modification. Thanks.
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
>
>>
>> regards,
>> dan carpenter
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-04-28 1:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-17 20:51 [f2fs-dev] [PATCH] f2fs: remove some dead code Christophe JAILLET
2023-04-18 4:43 ` Dan Carpenter
2023-04-27 16:28 ` Jaegeuk Kim
2023-04-28 1:01 ` Chao Yu
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).