1. 20 7月, 2012 1 次提交
    • A
      UBIFS: add debugfs knob to switch to R/O mode · 06bef945
      Artem Bityutskiy 提交于
      This patch adds another debugfs knob which switches UBIFS to R/O mode.
      I needed it while trying to reproduce the 'first log node is not CS node'
      bug. Without this debugfs knob you have to perform a power cut to repruduce
      the bug. The knob is named 'ro_error' and all it does is it sets the
      'ro_error' UBIFS flag which makes UBIFS disallow any further writes - even
      write-back will fail with -EROFS. Useful for debugging.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
      06bef945
  2. 27 6月, 2012 1 次提交
  3. 07 6月, 2012 1 次提交
  4. 21 5月, 2012 1 次提交
  5. 17 5月, 2012 4 次提交
  6. 29 2月, 2012 2 次提交
  7. 13 1月, 2012 2 次提交
  8. 22 8月, 2011 1 次提交
  9. 04 7月, 2011 16 次提交
  10. 23 5月, 2011 1 次提交
    • A
      UBIFS: switch to dynamic printks · 56e46742
      Artem Bityutskiy 提交于
      Switch to debugging using dynamic printk (pr_debug()). There is no good reason
      to carry custom debugging prints if there is so cool and powerful generic
      dynamic printk infrastructure, see Documentation/dynamic-debug-howto.txt. With
      dynamic printks we can switch on/of individual prints, per-file, per-function
      and per format messages. This means that instead of doing old-fashioned
      
      echo 1 > /sys/module/ubifs/parameters/debug_msgs
      
      to enable general messages, we can do:
      
      echo 'format "UBIFS DBG gen" +ptlf' > control
      
      to enable general messages and additionally ask the dynamic printk
      infrastructure to print process ID, line number and function name. So there is
      no reason to keep UBIFS-specific crud if there is more powerful generic thing.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      56e46742
  11. 16 5月, 2011 1 次提交
    • M
      UBIFS: add a superblock flag for free space fix-up · 9f58d350
      Matthew L. Creech 提交于
      The 'space_fixup' flag can be set in the superblock of a new filesystem by
      mkfs.ubifs to indicate that any eraseblocks with free space remaining should be
      fixed-up the first time it's mounted (after which the flag is un-set). This
      means that the UBIFS image has been flashed by a "dumb" flasher and the free
      space has been actually programmed (writing all 0xFFs), so this free space
      cannot be used. UBIFS fixes the free space up by re-writing the contents of all
      LEBs with free space using the atomic LEB change UBI operation.
      
      Artem: improved commit message, add some more commentaries to the code.
      Signed-off-by: NMatthew L. Creech <mlcreech@gmail.com>
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      9f58d350
  12. 14 5月, 2011 9 次提交
    • A
      UBIFS: fix debugging FS checking failure · 45cd5cdd
      Artem Bityutskiy 提交于
      When the debugging self-checks are enabled, we go trough whole file-system
      after mount and check/validate every single node referred to by the index.
      This is implemented by the 'dbg_check_filesystem()' function. However, this
      function fails if we mount "unclean" file-system, i.e., if we mount the
      file-system after a power cut. It fails with the following symptoms:
      
      UBIFS DBG (pid 8171): ubifs_recover_size: ino 937 size 3309925 -> 3317760
      UBIFS: recovery deferred
      UBIFS error (pid 8171): check_leaf: data node at LEB 1000:0 is not within inode size 3309925
      
      The reason of failure is that recovery fixed up the inode size in memory, but
      not on the flash so far. So the value on the flash is incorrect so far,
      and would be corrected when we re-mount R/W. But 'check_leaf()' ignores
      this fact and tries to validate the size of the on-flash inode, which is
      incorrect, so it fails.
      
      This patch teaches the checking code to look at the VFS inode cache first,
      and if there is the inode in question, use that inode instead of the inode
      on the flash media. This fixes the issue.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      45cd5cdd
    • A
      UBIFS: do not change debugfs file position · 341e262f
      Artem Bityutskiy 提交于
      This patch is a tiny improvement which removes few bytes of code.
      UBIFS debugfs files are non-seekable and the file position is ignored,
      so do not increase it in the write handler.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      341e262f
    • A
      UBIFS: fix oops in lprops dump function · 1321657d
      Artem Bityutskiy 提交于
      The 'dbg_dump_lprop()' is trying to detect journal head LEBs when printing,
      so it looks at the write-buffers. However, if we are in R/O mode, we
      de-allocate the write-buffers, so 'dbg_dump_lprop()' oopses. This patch fixes
      the issue.
      
      Note, this patch is not critical, it is only about the debugging code path, and
      it is unlikely that anyone but UBIFS developers would ever hit this issue.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      1321657d
    • A
      UBIFS: use EROFS when emulating failures · 1a29af8b
      Artem Bityutskiy 提交于
      When the debugging failure emulation is enabled and UBIFS decides to
      emulate an I/O error, it uses EIO error code. In which case UBIFS
      switches into R/O mode later on. The for the user-space is that when
      a failure is emulated, the file-system sometimes returns EIO and
      sometimes EROFS. This makes it more difficult to implement user-space
      tests for the failure mode. Let's be consistent and return EROFS in
      all the cases.
      
      This patch is an improvement for the debugging code and does not affect
      the functionality at all.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      1a29af8b
    • A
      UBIFS: make force in-the-gaps to be a general self-check · bc3f07f0
      Artem Bityutskiy 提交于
      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: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      bc3f07f0
    • A
      UBIFS: improve space checking debugging feature · f1bd66af
      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: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      f1bd66af
    • A
      UBIFS: rearrange the budget dump · 8c3067e4
      Artem Bityutskiy 提交于
      Re-arrange the budget dump and make sure we first dump all
      the 'struct ubifs_budg_info' fields, and then the other information.
      Additionally, print the 'uncommitted_idx' variable.
      
      This change is required for to the following dumping function
      enhancement where it will be possible to dump saved
      'struct ubifs_budg_info' objects, not only the current one.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      8c3067e4
    • A
      UBIFS: simplify dbg_dump_budg calling conventions · 8ff83089
      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: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      8ff83089
    • A
      UBIFS: introduce a separate structure for budgeting info · b137545c
      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: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      b137545c