All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Btrfs: scrub: remove unnecessary variable set
@ 2018-03-02 23:10 Liu Bo
  2018-03-06 10:36 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Liu Bo @ 2018-03-02 23:10 UTC (permalink / raw)
  To: linux-btrfs

Variable "success" is only checked when !sctx->is_dev_replace.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
 fs/btrfs/scrub.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index e3203a1..1b5ce2f 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -1444,7 +1444,6 @@ static int scrub_handle_errored_block(struct scrub_block *sblock_to_check)
 							    page_num) != 0) {
 				btrfs_dev_replace_stats_inc(
 					&fs_info->dev_replace.num_write_errors);
-				success = 0;
 			}
 		} else if (sblock_other) {
 			ret = scrub_repair_page_from_good_copy(sblock_bad,
-- 
2.9.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Btrfs: scrub: remove unnecessary variable set
  2018-03-02 23:10 [PATCH] Btrfs: scrub: remove unnecessary variable set Liu Bo
@ 2018-03-06 10:36 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2018-03-06 10:36 UTC (permalink / raw)
  To: Liu Bo; +Cc: linux-btrfs

On Fri, Mar 02, 2018 at 04:10:40PM -0700, Liu Bo wrote:
> Variable "success" is only checked when !sctx->is_dev_replace.

Though it's right, the code becomes less obvious at least to me that
it's not missing something. There are several conditions and branches,
one more explicit variable setting will not kill the performance but
helps to understand the code flow.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-06 10:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-02 23:10 [PATCH] Btrfs: scrub: remove unnecessary variable set Liu Bo
2018-03-06 10:36 ` David Sterba

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.