Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 201806
b: refs/heads/master
c: 6fb4374
h: refs/heads/master
v: v3
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Jul 13, 2010
1 parent fe8b8a6 commit ccdf977
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6da5156fad495730cca9238ead566222175b30b9
refs/heads/master: 6fb4374f6b1b3932f3acfe9d353568d3d8599cad
23 changes: 18 additions & 5 deletions trunk/fs/ubifs/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* This file implements functions needed to recover from unclean un-mounts.
* When UBIFS is mounted, it checks a flag on the master node to determine if
* an un-mount was completed successfully. If not, the process of mounting
* incorparates additional checking and fixing of on-flash data structures.
* incorporates additional checking and fixing of on-flash data structures.
* UBIFS always cleans away all remnants of an unclean un-mount, so that
* errors do not accumulate. However UBIFS defers recovery if it is mounted
* read-only, and the flash is not modified in that case.
Expand Down Expand Up @@ -1063,8 +1063,21 @@ int ubifs_rcvry_gc_commit(struct ubifs_info *c)
}
err = ubifs_find_dirty_leb(c, &lp, wbuf->offs, 2);
if (err) {
if (err == -ENOSPC)
dbg_err("could not find a dirty LEB");
/*
* There are no dirty or empty LEBs subject to here being
* enough for the index. Try to use
* 'ubifs_find_free_leb_for_idx()', which will return any empty
* LEBs (ignoring index requirements). If the index then
* doesn't have enough LEBs the recovery commit will fail -
* which is the same result anyway i.e. recovery fails. So
* there is no problem ignoring index requirements and just
* grabbing a free LEB since we have already established there
* is not a dirty LEB we could have used instead.
*/
if (err == -ENOSPC) {
dbg_rcvry("could not find a dirty LEB");
goto find_free;
}
return err;
}
ubifs_assert(!(lp.flags & LPROPS_INDEX));
Expand Down Expand Up @@ -1139,8 +1152,8 @@ int ubifs_rcvry_gc_commit(struct ubifs_info *c)
find_free:
/*
* There is no GC head LEB or the free space in the GC head LEB is too
* small. Allocate gc_lnum by calling 'ubifs_find_free_leb_for_idx()' so
* GC is not run.
* small, or there are not dirty LEBs. Allocate gc_lnum by calling
* 'ubifs_find_free_leb_for_idx()' so GC is not run.
*/
lnum = ubifs_find_free_leb_for_idx(c);
if (lnum < 0) {
Expand Down

0 comments on commit ccdf977

Please sign in to comment.