From 8630d2363be3b57569acff6d323f7d8a8c3d3ce9 Mon Sep 17 00:00:00 2001
From: root <root@localhost.localdomain>
Date: Wed, 13 Mar 2019 21:56:11 +0800
Subject: [PATCH 14/19] cov: avoid unsing unchecked label_scan_open

Drop extra call too label_scan_open() without checking return value,
and let code go through next call bellow.
---
 lib/label/label.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/label/label.c b/lib/label/label.c
index 63300d2..8efc89e 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -1313,9 +1313,7 @@ bool dev_set_bytes(struct device *dev, uint64_t start, size_t len, uint8_t val)
 		log_debug("Close and reopen to write %s", dev_name(dev));
 		bcache_invalidate_fd(scan_bcache, dev->bcache_fd);
 		_scan_dev_close(dev);
-
-		dev->flags |= DEV_BCACHE_WRITE;
-		label_scan_open(dev);
+		/* goes to label_scan_open() since bcache_fd < 0 */
 	}
 
 	if (dev->bcache_fd <= 0) {
-- 
2.19.1

