15 Jul, 2017

1 commit

  • A reference to LEB 0 or with length 0 in the TNC
    is never correct and could be caused by a memory corruption.
    Don't write such a bad index node to the MTD.
    Instead fail the commit which will turn UBIFS into read-only mode.

    This is less painful than having the bad reference on the MTD
    from where UBFIS has no chance to recover.

    Signed-off-by: Richard Weinberger

    Richard Weinberger
     

24 Aug, 2016

1 commit

  • An assertion in layout_in_gaps() verifies that the gap_lebs pointer is
    below the maximum bound. When computing this maximum bound the idx_lebs
    count is multiplied by sizeof(int), while C pointers arithmetic does take
    into account the size of the pointed elements implicitly already. Remove
    the multiplication to fix the assertion.

    Fixes: 1e51764a3c2ac05a ("UBIFS: add new flash file system")
    Cc:
    Signed-off-by: Vincent Stehlé
    Cc: Artem Bityutskiy
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: Richard Weinberger

    Vincent Stehlé
     

25 Mar, 2015

1 commit

  • In the case where we have more than one volumes on different UBI
    devices, it may be not that easy to tell which volume prints the
    messages. Add ubi number and volume id in ubifs_msg/warn/error
    to help debug. These two values are passed by struct ubifs_info.

    For those where ubifs_info is not initialized yet, ubifs_* is
    replaced by pr_*. For those where ubifs_info is not avaliable,
    ubifs_info is passed to the calling function as a const parameter.

    The output looks like,

    [ 95.444879] UBIFS (ubi0:1): background thread "ubifs_bgt0_1" started, PID 696
    [ 95.484688] UBIFS (ubi0:1): UBIFS: mounted UBI device 0, volume 1, name "test1"
    [ 95.484694] UBIFS (ubi0:1): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
    [ 95.484699] UBIFS (ubi0:1): FS size: 30220288 bytes (28 MiB, 238 LEBs), journal size 1523712 bytes (1 MiB, 12 LEBs)
    [ 95.484703] UBIFS (ubi0:1): reserved for root: 1427378 bytes (1393 KiB)
    [ 95.484709] UBIFS (ubi0:1): media format: w4/r0 (latest is w4/r0), UUID 40DFFC0E-70BE-4193-8905-F7D6DFE60B17, small LPT model
    [ 95.489875] UBIFS (ubi1:0): background thread "ubifs_bgt1_0" started, PID 699
    [ 95.529713] UBIFS (ubi1:0): UBIFS: mounted UBI device 1, volume 0, name "test2"
    [ 95.529718] UBIFS (ubi1:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
    [ 95.529724] UBIFS (ubi1:0): FS size: 19808256 bytes (18 MiB, 156 LEBs), journal size 1015809 bytes (0 MiB, 8 LEBs)
    [ 95.529727] UBIFS (ubi1:0): reserved for root: 935592 bytes (913 KiB)
    [ 95.529733] UBIFS (ubi1:0): media format: w4/r0 (latest is w4/r0), UUID EEB7779D-F419-4CA9-811B-831CAC7233D4, small LPT model

    [ 954.264767] UBIFS error (ubi1:0 pid 756): ubifs_read_node: bad node type (255 but expected 6)
    [ 954.367030] UBIFS error (ubi1:0 pid 756): ubifs_read_node: bad node at LEB 0:0, LEB mapping status 1

    Signed-off-by: Sheng Yong
    Signed-off-by: Artem Bityutskiy

    Sheng Yong
     

19 Jul, 2014

1 commit


18 Apr, 2014

1 commit

  • Mostly scripted conversion of the smp_mb__* barriers.

    Signed-off-by: Peter Zijlstra
    Acked-by: Paul E. McKenney
    Link: http://lkml.kernel.org/n/tip-55dhyhocezdw1dg7u19hmh1u@git.kernel.org
    Cc: Linus Torvalds
    Cc: linux-arch@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

15 Jan, 2013

1 commit


21 May, 2012

1 commit

  • We do not need this feature and to our shame it even was not working
    and there was a bug found very recently.
    -- Artem Bityutskiy

    Without the data type hint UBI2 (fastmap) will be easier to implement.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Artem Bityutskiy

    Richard Weinberger
     

17 May, 2012

2 commits


04 Jul, 2011

5 commits

  • We have too many different debugging checks - lessen the amount by merging all
    index-related checks into one. At the same time, move the "force in-the-gap"
    test to the "index checks" class, because it is too heavy for the "general"
    class.

    This patch merges TNC, Old index, and Index size check and calles this just
    "index checks".

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • This patch introduces helper functions for all debugging checks, so instead of
    doing

    if (!(ubifs_chk_flags & UBIFS_CHK_GEN))

    we now do

    if (!dbg_is_chk_gen(c))

    This is a preparation to further changes where the flags will go away, and
    we'll need to only change the helper functions, but the code which utilizes
    them won't be touched.

    At the same time this patch removes 'dbg_force_in_the_gaps()',
    'dbg_force_in_the_gaps_enabled()', and dbg_failure_mode helpers for
    consistency.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • Add a couple of comments - while looking into TNC I could not easily figure out
    few facts, so it is a good idea to document them in the code.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • We have 3 znode flags: cow, obsolete, dirty. For the last flag we have a
    'ubifs_zn_dirty()' helper function, but for the other 2 flags we use
    'test_bit()' directly.

    This patch makes the situation more consistent and introduces helpers for the
    other 2 flags: 'ubifs_zn_cow()' and 'ubifs_zn_obsolete()'.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • Remove dead pieces of code under "if (c->min_io_size == 1)" statement -
    we never execute it because in UBIFS 'c->min_io_size' is always at least 8.
    This are leftovers from old pre-mainline prototype.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     

14 May, 2011

4 commits

  • UBIFS can force itself to use the 'in-the-gaps' commit method - the last resort
    method which is normally invoced very very rarely. Currently this "force
    int-the-gaps" debugging feature is a separate test mode. But it is a bit saner
    to make it to be the "general" self-test check instead.

    This patch is just a clean-up which should make the debugging code look a bit
    nicer and easier to use - we have way too many debugging options.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • This patch improves the 'dbg_check_space_info()' function which checks
    whether the amount of space before re-mounting and after re-mounting
    is the same (remounting from R/O to R/W modes and vice-versa).

    The problem is that 'dbg_check_space_info()' does not save the budgeting
    information before re-mounting, so when an error is reported, we do not
    know why the amount of free space changed.

    This patches makes the following changes:

    1. Teaches 'dbg_dump_budg()' function to accept a 'struct ubifs_budg_info'
    argument and print out the this argument. This way we may ask it to
    print any saved budgeting info, no only the current one.
    2. Accordingly changes all the callers of 'dbg_dump_budg()' to comply with
    the changed interface.
    3. Introduce a 'saved_bi' (saved budgeting info) field to
    'struct ubifs_debug_info' and save the budgeting info before re-mounting
    there.
    4. Change 'dbg_check_space_info()' and make it print both old and new
    budgeting information.
    5. Additionally, save 'c->igx_gc_cnt' and print it if and error happens. This
    value contributes to the amount of free space, so we have to print it.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • The current 'dbg_dump_budg()' calling convention is that the
    'c->space_lock' spinlock is held. However, none of the callers
    actually use it from contects which have 'c->space_lock' locked,
    so all callers have to explicitely lock and unlock the spinlock.
    This is not very sensible convention. This patch changes it and
    makes 'dbg_dump_budg()' lock the spinlock instead of imposing this
    to the callers. This simplifies the code a little.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • This patch separates out all the budgeting-related information
    from 'struct ubifs_info' to 'struct ubifs_budg_info'. This way the
    code looks a bit cleaner. However, the main driver for this is
    that we want to save budgeting information and print it later,
    so a separate data structure for this is helpful.

    This patch is a preparation for the further debugging output
    improvements.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     

10 Sep, 2009

1 commit

  • At the moment UBIFS print large and scary error messages and
    flash dumps in case of nearly any corruption, even if it is
    a recoverable corruption. For example, if the master node is
    corrupted, ubifs_scan() prints error dumps, then UBIFS recovers
    just fine and goes on.

    This patch makes UBIFS print scary error messages only in
    real cases, which are not recoverable. It adds 'quiet' argument
    to the 'ubifs_scan()' function, so the caller may ask 'ubi_scan()'
    not to print error messages if the caller is able to do recovery.

    Signed-off-by: Artem Bityutskiy
    Reviewed-by: Adrian Hunter

    Artem Bityutskiy
     

23 Dec, 2008

1 commit


03 Dec, 2008

1 commit


13 Aug, 2008

1 commit


15 Jul, 2008

1 commit