Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 253003
b: refs/heads/master
c: efcfde5
h: refs/heads/master
i:
  253001: a4f3b53
  252999: 763e0c7
v: v3
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Jun 1, 2011
1 parent b472ed3 commit 0dda7e7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 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: 1a0b06997ceca96db9259e537eb935f9fe59a3de
refs/heads/master: efcfde54ca68091b164f9aec544c7233a9760aff
2 changes: 1 addition & 1 deletion trunk/fs/ubifs/orphan.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ static int kill_orphans(struct ubifs_info *c)
if (IS_ERR(sleb)) {
if (PTR_ERR(sleb) == -EUCLEAN)
sleb = ubifs_recover_leb(c, lnum, 0,
c->sbuf, 0);
c->sbuf, -1);
if (IS_ERR(sleb)) {
err = PTR_ERR(sleb);
break;
Expand Down
10 changes: 6 additions & 4 deletions trunk/fs/ubifs/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,21 +604,23 @@ static int drop_last_node(struct ubifs_scan_leb *sleb, int *offs, int grouped)
* @lnum: LEB number
* @offs: offset
* @sbuf: LEB-sized buffer to use
* @grouped: nodes may be grouped for recovery
* @jhead: journal head number this LEB belongs to (%-1 if the LEB does not
* belong to any journal head)
*
* This function does a scan of a LEB, but caters for errors that might have
* been caused by the unclean unmount from which we are attempting to recover.
* Returns %0 in case of success, %-EUCLEAN if an unrecoverable corruption is
* found, and a negative error code in case of failure.
*/
struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum,
int offs, void *sbuf, int grouped)
int offs, void *sbuf, int jhead)
{
int ret = 0, err, len = c->leb_size - offs, start = offs, min_io_unit;
int grouped = jhead == -1 ? 0 : c->jheads[jhead].grouped;
struct ubifs_scan_leb *sleb;
void *buf = sbuf + offs;

dbg_rcvry("%d:%d", lnum, offs);
dbg_rcvry("%d:%d, jhead %d, grouped %d", lnum, offs, jhead, grouped);

sleb = ubifs_start_scan(c, lnum, offs, sbuf);
if (IS_ERR(sleb))
Expand Down Expand Up @@ -881,7 +883,7 @@ struct ubifs_scan_leb *ubifs_recover_log_leb(struct ubifs_info *c, int lnum,
}
ubifs_scan_destroy(sleb);
}
return ubifs_recover_leb(c, lnum, offs, sbuf, 0);
return ubifs_recover_leb(c, lnum, offs, sbuf, -1);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/ubifs/replay.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,7 @@ static int replay_bud(struct ubifs_info *c, struct bud_entry *b)
* these LEBs could possibly be written to at the power cut
* time.
*/
sleb = ubifs_recover_leb(c, lnum, offs, c->sbuf,
b->bud->jhead != GCHD);
sleb = ubifs_recover_leb(c, lnum, offs, c->sbuf, b->bud->jhead);
else
sleb = ubifs_scan(c, lnum, offs, c->sbuf, 0);
if (IS_ERR(sleb))
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/ubifs/ubifs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1744,7 +1744,7 @@ struct inode *ubifs_iget(struct super_block *sb, unsigned long inum);
int ubifs_recover_master_node(struct ubifs_info *c);
int ubifs_write_rcvrd_mst_node(struct ubifs_info *c);
struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum,
int offs, void *sbuf, int grouped);
int offs, void *sbuf, int jhead);
struct ubifs_scan_leb *ubifs_recover_log_leb(struct ubifs_info *c, int lnum,
int offs, void *sbuf);
int ubifs_recover_inl_heads(const struct ubifs_info *c, void *sbuf);
Expand Down

0 comments on commit 0dda7e7

Please sign in to comment.