[Skiboot] [PATCH] libflash/libffs: Correctly update the actual size of the partition

Cyril Bur cyril.bur at au1.ibm.com
Wed Jun 21 16:34:36 AEST 2017


libffs has been updating FFS partition information in the wrong place
which leads to incomplete erases and corruption.

Fixes: 602dee45 libflash/libffs: Rework libffs
Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
---
 libflash/libffs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libflash/libffs.c b/libflash/libffs.c
index dca40188..6d896334 100644
--- a/libflash/libffs.c
+++ b/libflash/libffs.c
@@ -781,7 +781,7 @@ int ffs_update_act_size(struct ffs_handle *ffs, uint32_t part_idx,
 		FL_DBG("FFS: Entry not found\n");
 		return FFS_ERR_PART_NOT_FOUND;
 	}
-	offset = ent->base;
+	offset = ffs->toc_offset + ffs_hdr_raw_size(part_idx);
 	FL_DBG("FFS: part index %d at offset 0x%08x\n",
 	       part_idx, offset);
 
-- 
2.13.1



More information about the Skiboot mailing list