[PATCH] UBIFS: optionally return partial LEB scan results

Artem Bityutskiy dedekind1 at gmail.com
Wed Jun 8 10:16:09 EDT 2011


On Tue, 2011-06-07 at 16:52 -0400, Matthew L. Creech wrote:
> ubifs_scan() currently returns -EUCLEAN when it encounters corrupted data
> while scanning a LEB.  This is usually the right thing to do, but it prevents
> us from debugging certain kinds of corruption, since ubifs_scan() is called
> from dbg_dump_leb().
> 
> Add a flag which makes ubifs_scan() return partial node data when corruption
> is encountered, and use that flag in dbg_dump_leb().
> 
> Signed-off-by: Matthew L. Creech <mlcreech at gmail.com>
> ---
>  fs/ubifs/debug.c      |    2 +-
>  fs/ubifs/gc.c         |    2 +-
>  fs/ubifs/log.c        |    2 +-
>  fs/ubifs/lprops.c     |    2 +-
>  fs/ubifs/master.c     |    4 ++--
>  fs/ubifs/orphan.c     |    4 ++--
>  fs/ubifs/recovery.c   |    2 +-
>  fs/ubifs/replay.c     |    4 ++--
>  fs/ubifs/scan.c       |   16 ++++++++++++----
>  fs/ubifs/tnc_commit.c |    2 +-
>  fs/ubifs/ubifs.h      |    2 +-
>  11 files changed, 25 insertions(+), 17 deletions(-)

Thanks, but I think I'll do it differently. If the ubifs_scan() quiet
parameter is 0, then I can notice that this mean that the caller expects
corruptions and will fix it up. In which case current code will re-scan
the LEB. And I will make it so that if quiet == 0, then the scanned
buffer is not destroyed.

This will first of all make sure we do not read the same LEB 2 times
when recovering. And second of all - this is anyway needed to handle
unstable bits. So I'll be working on this change myself.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list