mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jan Luebbe <jluebbe@debian.org>
To: barebox@lists.infradead.org
Subject: [PATCH 1/2] state: handle write-protection in the raw backend
Date: Thu, 30 Jul 2015 17:26:22 +0200	[thread overview]
Message-ID: <1438269983-30931-1-git-send-email-jluebbe@debian.org> (raw)

Signed-off-by: Jan Luebbe <jluebbe@debian.org>
---
 common/state.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/common/state.c b/common/state.c
index 1243320..1ff0e24 100644
--- a/common/state.c
+++ b/common/state.c
@@ -1377,6 +1377,8 @@ static int backend_raw_save_one(struct state_backend_raw *backend_raw,
 	if (ret < 0)
 		return ret;
 
+	protect(fd, backend_raw->stride, offset, false);
+
 	if (backend_raw->need_erase) {
 		ret = erase(fd, backend_raw->stride, offset);
 		if (ret)
@@ -1387,6 +1389,8 @@ static int backend_raw_save_one(struct state_backend_raw *backend_raw,
 	if (ret < 0)
 		return ret;
 
+	protect(fd, backend_raw->stride, offset, true);
+
 	return 0;
 }
 
-- 
2.1.4


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

             reply	other threads:[~2015-07-30 15:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30 15:26 Jan Luebbe [this message]
2015-07-30 15:26 ` [PATCH 2/2] state: fix missing newline in error message Jan Luebbe
2015-07-31  8:19 ` [PATCH 1/2] state: handle write-protection in the raw backend 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=1438269983-30931-1-git-send-email-jluebbe@debian.org \
    --to=jluebbe@debian.org \
    --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