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:
parent
66d7674f8b
commit
1fde9ef265
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue