[PATCH 2/2] state: bucket_circular: -EUCLEAN means data could be read

Sascha Hauer s.hauer at pengutronix.de
Thu Mar 23 06:21:42 PDT 2017


-EUCLEAN returned from state_mtd_peb_read() means that the
data shall still be used. This fixes initialization of buckets
which need cleanup

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/state/backend_bucket_circular.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/state/backend_bucket_circular.c b/common/state/backend_bucket_circular.c
index d8504e035c..9cb9dce2ac 100644
--- a/common/state/backend_bucket_circular.c
+++ b/common/state/backend_bucket_circular.c
@@ -390,7 +390,7 @@ static int state_backend_bucket_circular_init(
 
 		ret = state_mtd_peb_read(circ, buf, sub_offset,
 					 circ->writesize);
-		if (ret)
+		if (ret && ret != -EUCLEAN)
 			return ret;
 
 		ret = mtd_buf_all_ff(buf, circ->writesize);
-- 
2.11.0




More information about the barebox mailing list