state: handle write-protection in the raw backend
Signed-off-by: Jan Luebbe <jluebbe@debian.org>
This commit is contained in:
parent
0b3fd92ffb
commit
cb9695a3ea
|
@ -1201,6 +1201,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)
|
||||
|
@ -1211,6 +1213,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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue