mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 1/2] state: bucket_cached: Fix reading pages which need cleanup
Date: Thu, 23 Mar 2017 14:21:41 +0100	[thread overview]
Message-ID: <20170323132142.28871-1-s.hauer@pengutronix.de> (raw)

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>
---
 common/state/backend_bucket_cached.c | 8 ++++----
 1 file 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,
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2017-03-23 13:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23 13:21 Sascha Hauer [this message]
2017-03-23 13:21 ` [PATCH 2/2] state: bucket_circular: -EUCLEAN means data could be read Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170323132142.28871-1-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox