9
0
Fork 0

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>
This commit is contained in:
Sascha Hauer 2017-03-20 13:30:33 +01:00
parent 66d7674f8b
commit 1fde9ef265
1 changed files with 4 additions and 4 deletions

View File

@ -52,12 +52,12 @@ static int state_backend_bucket_cache_fill(
int ret; int ret;
ret = cache->raw->read(cache->raw, &cache->data, &cache->data_len); ret = cache->raw->read(cache->raw, &cache->data, &cache->data_len);
if (ret == -EUCLEAN) if (ret == -EUCLEAN) {
cache->force_write = true; cache->force_write = true;
else if (ret) ret = 0;
return ret; }
return 0; return ret;
} }
static int state_backend_bucket_cache_read(struct state_backend_storage_bucket *bucket, static int state_backend_bucket_cache_read(struct state_backend_storage_bucket *bucket,