diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-06-29 10:59:23 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-07-09 02:19:38 -0400 |
commit | ed43f2f06cc1cec7ec2dc235c908530bc8c796eb (patch) | |
tree | 7d178c64dc5a758487cc0fca834c4ab42e62febc /fs/ubifs/recovery.c | |
parent | 086b3640c10ab448a6993c4bae1508f496f530c4 (diff) |
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/recovery.c')
-rw-r--r-- | fs/ubifs/recovery.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c index 805605250f12..093a1ecb700f 100644 --- a/fs/ubifs/recovery.c +++ b/fs/ubifs/recovery.c | |||
@@ -543,8 +543,8 @@ static int drop_incomplete_group(struct ubifs_scan_leb *sleb, int *offs) | |||
543 | * | 543 | * |
544 | * This function does a scan of a LEB, but caters for errors that might have | 544 | * This function does a scan of a LEB, but caters for errors that might have |
545 | * been caused by the unclean unmount from which we are attempting to recover. | 545 | * been caused by the unclean unmount from which we are attempting to recover. |
546 | * | 546 | * Returns %0 in case of success, %-EUCLEAN if an unrecoverable corruption is |
547 | * This function returns %0 on success and a negative error code on failure. | 547 | * found, and a negative error code in case of failure. |
548 | */ | 548 | */ |
549 | struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum, | 549 | struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum, |
550 | int offs, void *sbuf, int grouped) | 550 | int offs, void *sbuf, int grouped) |
@@ -643,7 +643,8 @@ struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum, | |||
643 | goto corrupted; | 643 | goto corrupted; |
644 | default: | 644 | default: |
645 | dbg_err("unknown"); | 645 | dbg_err("unknown"); |
646 | goto corrupted; | 646 | err = -EINVAL; |
647 | goto error; | ||
647 | } | 648 | } |
648 | } | 649 | } |
649 | 650 | ||