Skip to content

Commit

Permalink
UBIFS: allow for gaps when dirtying the LPT
Browse files Browse the repository at this point in the history
The LPT may have gaps in it because initially empty LEBs
are not added by mkfs.ubifs - because it does not know how
many there are.  Then UBIFS allocates empty LEBs in the
reverse order that they are discovered i.e. they are
added to, and removed from, the front of a list.  That
creates a gap in the middle of the LPT.

The function dirtying the LPT tree (for the purpose of
small model garbage collection) assumed that a gap could
only occur at the very end of the LPT and stopped dirtying
prematurely, which in turn resulted in the LPT running
out of space - something that is designed to be impossible.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
  • Loading branch information
Adrian Hunter authored and Artem Bityutskiy committed Nov 7, 2008
1 parent e84461a commit 7e2d9bf
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions fs/ubifs/lpt_commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,6 @@ static struct ubifs_pnode *next_pnode(struct ubifs_info *c,
/* We assume here that LEB zero is never an LPT LEB */
if (nnode->nbranch[iip].lnum)
return ubifs_get_pnode(c, nnode, iip);
else
return NULL;
}

/* Go up while can't go right */
Expand Down

0 comments on commit 7e2d9bf

Please sign in to comment.