summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-20 13:30:33 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-23 14:21:33 +0100
commit1fde9ef265ac5713496242b3f777412f607870f2 (patch)
tree643af557610480af5312a7b3e560360f1bab0fa5
parent66d7674f8babfebac46ee203f7d64deda0d7ab21 (diff)
downloadbarebox-1fde9ef265ac5713496242b3f777412f607870f2.tar.gz
barebox-1fde9ef265ac5713496242b3f777412f607870f2.tar.xz
state: bucket_cached: Fix reading pages which need cleanup
When the raw device returns -EUCLEAN we have to return successfully to the upper layer, otherwise it will discard the data. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--common/state/backend_bucket_cached.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/state/backend_bucket_cached.c b/common/state/backend_bucket_cached.c
index 781ac2debd..ba0af7f373 100644
--- a/common/state/backend_bucket_cached.c
+++ b/common/state/backend_bucket_cached.c
@@ -52,12 +52,12 @@ static int state_backend_bucket_cache_fill(
int ret;
ret = cache->raw->read(cache->raw, &cache->data, &cache->data_len);
- if (ret == -EUCLEAN)
+ if (ret == -EUCLEAN) {
cache->force_write = true;
- else if (ret)
- return ret;
+ ret = 0;
+ }
- return 0;
+ return ret;
}
static int state_backend_bucket_cache_read(struct state_backend_storage_bucket *bucket,