summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-20 14:08:13 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-21 09:47:09 +0100
commitdaa27f0a69aeb5dcb3a7a2e5dc2ae35c465e7782 (patch)
treeba6c4457c2eef7d313f74d0ee6ae490b9dede5a3
parent89135e5522720bc75615a6ec22bb8bcb7b4994e2 (diff)
downloaddt-utils-daa27f0a69aeb5dcb3a7a2e5dc2ae35c465e7782.tar.gz
dt-utils-daa27f0a69aeb5dcb3a7a2e5dc2ae35c465e7782.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--src/barebox-state/backend_bucket_cached.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/barebox-state/backend_bucket_cached.c b/src/barebox-state/backend_bucket_cached.c
index 781ac2d..ba0af7f 100644
--- a/src/barebox-state/backend_bucket_cached.c
+++ b/src/barebox-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,