summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-23 11:29:50 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-31 13:57:49 +0200
commit583acea6669550ffa7ffb465301ddb3529206afc (patch)
tree5ffea726286445f7253403b2a370fdcf253258a8
parent97d974d028f752d033634a608c5d43f335310ed6 (diff)
downloaddt-utils-583acea6669550ffa7ffb465301ddb3529206afc.tar.gz
dt-utils-583acea6669550ffa7ffb465301ddb3529206afc.tar.xz
state: backend-direct: Fix max_size
The max_size in the direct backend includes the meta data, so substract its size when determing the max data size we can store. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--src/barebox-state/backend_bucket_direct.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/barebox-state/backend_bucket_direct.c b/src/barebox-state/backend_bucket_direct.c
index 246cb49..9996ac2 100644
--- a/src/barebox-state/backend_bucket_direct.c
+++ b/src/barebox-state/backend_bucket_direct.c
@@ -103,7 +103,7 @@ static int state_backend_bucket_direct_write(struct state_backend_storage_bucket
int ret;
struct state_backend_storage_bucket_direct_meta meta;
- if (direct->max_size && len > direct->max_size)
+ if (direct->max_size && len > direct->max_size - sizeof(meta))
return -E2BIG;
ret = lseek(direct->fd, direct->offset, SEEK_SET);