Skip to content

Commit

Permalink
fix a chuck missed when sparse file split happen at whole chunck
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Li <frank.li@nxp.com>
  • Loading branch information
nxpfrankli committed Jan 13, 2021
1 parent f1d41e2 commit 8e9e189
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libuuu/fastboot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ int FBFlashCmd::run(CmdCtx *ctx)
for(size_t nblk=0; nblk < pfile->total_chunks && pos <= pdata->size(); nblk++)
{
pdata->request_data(pos+sizeof(chunk_header_t)+sizeof(sparse_header));
size_t oldpos = pos;
pheader = SparseFile::get_next_chunk(pdata->data(), pos);
pdata->request_data(pos);

Expand All @@ -694,6 +695,11 @@ int FBFlashCmd::run(CmdCtx *ctx)

sz = sf.push_one_chuck(&ct, nullptr);

/*
roll back pos to previous failure chunck and let it push again into new sparse file.
can't push it here because next chuck may big size chuck and need split as below else logic.
*/
pos = oldpos;
uuu_notify nt;
nt.type = uuu_notify::NOTIFY_TRANS_POS;
nt.total = startblock;
Expand Down

0 comments on commit 8e9e189

Please sign in to comment.