diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-06-29 17:59:23 +0300 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-07-09 09:19:38 +0300 |
commit | ed43f2f06cc1cec7ec2dc235c908530bc8c796eb (patch) | |
tree | 7d178c64dc5a758487cc0fca834c4ab42e62febc /fs/ubifs/replay.c | |
parent | 086b3640c10ab448a6993c4bae1508f496f530c4 (diff) | |
download | op-kernel-dev-ed43f2f06cc1cec7ec2dc235c908530bc8c796eb.zip op-kernel-dev-ed43f2f06cc1cec7ec2dc235c908530bc8c796eb.tar.gz |
UBIFS: small amendments in the LEB scanning code
This patch fixes few minor things I've spotted while going through
code:
1. Better document return codes
2. If 'ubifs_scan_a_node()' returns some thing we do not expect,
treat this as an error.
3. Try to do recovery only when 'ubifs_scan()' returns %-EUCLEAN,
not on any error.
4. If empty space starts at a non-aligned address, print a message.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Reviewed-by: Adrian Hunter <Adrian.Hunter@nokia.com>
Diffstat (limited to 'fs/ubifs/replay.c')
-rw-r--r-- | fs/ubifs/replay.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c index 769be42..2970500 100644 --- a/fs/ubifs/replay.c +++ b/fs/ubifs/replay.c @@ -837,9 +837,10 @@ static int replay_log_leb(struct ubifs_info *c, int lnum, int offs, void *sbuf) dbg_mnt("replay log LEB %d:%d", lnum, offs); sleb = ubifs_scan(c, lnum, offs, sbuf); - if (IS_ERR(sleb)) { - if (c->need_recovery) - sleb = ubifs_recover_log_leb(c, lnum, offs, sbuf); + if (IS_ERR(sleb) ) { + if (PTR_ERR(sleb) != -EUCLEAN || !c->need_recovery) + return PTR_ERR(sleb); + sleb = ubifs_recover_log_leb(c, lnum, offs, sbuf); if (IS_ERR(sleb)) return PTR_ERR(sleb); } |