1. 04 7月, 2011 2 次提交
    • A
      UBIFS: introduce helper functions for debugging checks and tests · 2b1844a8
      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: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      2b1844a8
    • A
      UBIFS: use correct flags in lprops · 37662447
      Artem Bityutskiy 提交于
      The UBIFS lpt tree is in many aspects similar to the TNC tree, and we have
      similar flags for these trees. And by mistake we use the COW_ZNODE flag for
      LPT in some places, instead of the right flag COW_CNODE. And this works
      only because these two constants have the same value.
      
      This patch makes all the LPT code to use COW_CNODE and also changes COW_CNODE
      constant value to make sure we do not misuse the flags any more.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      37662447
  2. 14 5月, 2011 2 次提交
  3. 24 3月, 2011 1 次提交
  4. 16 3月, 2011 2 次提交
    • A
      UBIFS: allocate lpt dump buffer on demand · cab95d44
      Artem Bityutskiy 提交于
      Instead of using pre-allocated 'c->dbg->buf' buffer in
      'dump_lpt_leb()', dynamically allocate it when needed. The intend
      is to get rid of the pre-allocated 'c->dbg->buf' buffer and save
      128KiB of RAM (or more if PEB size is larger). Indeed, currently we
      allocate this memory even if the user never enables any self-check,
      which is wasteful.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      cab95d44
    • A
      UBIFS: allocate ltab checking buffer on demand · 6fb324a4
      Artem Bityutskiy 提交于
      Instead of using pre-allocated 'c->dbg->buf' buffer in
      'dbg_check_ltab_lnum()', dynamically allocate it when needed. The
      intend is to get rid of the pre-allocated 'c->dbg->buf' buffer and
      save 128KiB of RAM (or more if PEB size is larger). Indeed,
      currently we allocate this memory even if the user never enables
      any self-check, which is wasteful.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      6fb324a4
  5. 07 9月, 2010 1 次提交
  6. 12 6月, 2010 1 次提交
  7. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  8. 21 3月, 2009 1 次提交
  9. 16 3月, 2009 2 次提交
    • A
      UBIFS: use KERN_CONT · c9927c3e
      Artem Bityutskiy 提交于
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      c9927c3e
    • A
      UBIFS: fix lprops committing bug · 0a6fb8d9
      Artem Bityutskiy 提交于
      When writing lprop nodes, do not forget to set @from to 0 when
      switching the LEB. This fixes the following bug:
      
      UBIFS error (pid 27768): ubifs_leb_write: writing -15456 bytes at 16:15880, error -22
      UBIFS error (pid 27768): do_commit: commit failed, error -22
      UBIFS warning (pid 27768): ubifs_ro_mode: switched to read-only mode, error -22
      Pid: 27768, comm: freespace Not tainted 2.6.29-rc4-ubifs-2.6 #43
      Call Trace:
       [<ffffffffa00c46d6>] ubifs_ro_mode+0x54/0x56 [ubifs]
       [<ffffffffa00cfa16>] do_commit+0x4f5/0x50a [ubifs]
       [<ffffffffa00cfae7>] ubifs_run_commit+0xbc/0xdb [ubifs]
       [<ffffffffa00d42b9>] ubifs_budget_space+0x742/0x9ed [ubifs]
       [<ffffffff812daf45>] ? __mutex_lock_common+0x361/0x3ae
       [<ffffffffa00bc437>] ? ubifs_write_begin+0x18d/0x44c [ubifs]
       [<ffffffffa00bc5cb>] ubifs_write_begin+0x321/0x44c [ubifs]
       [<ffffffff8106222b>] ? trace_hardirqs_on_caller+0x1f/0x14d
       [<ffffffff81097ce2>] generic_file_buffered_write+0x12f/0x2d9
       [<ffffffff8109828d>] __generic_file_aio_write_nolock+0x261/0x295
       [<ffffffff81098aff>] generic_file_aio_write+0x69/0xc5
       [<ffffffffa00bb914>] ubifs_aio_write+0x14c/0x19e [ubifs]
       [<ffffffff810c8f42>] do_sync_write+0xe7/0x12d
       [<ffffffff81055378>] ? autoremove_wake_function+0x0/0x38
       [<ffffffff81149edc>] ? security_file_permission+0x11/0x13
       [<ffffffff810c9827>] vfs_write+0xab/0x105
       [<ffffffff810c9945>] sys_write+0x47/0x6f
       [<ffffffff8100c35b>] system_call_fastpath+0x16/0x1b
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      0a6fb8d9
  10. 09 2月, 2009 1 次提交
  11. 28 1月, 2009 1 次提交
  12. 31 12月, 2008 2 次提交
  13. 03 12月, 2008 4 次提交
  14. 07 11月, 2008 1 次提交
    • A
      UBIFS: allow for gaps when dirtying the LPT · 7e2d9bfa
      Adrian Hunter 提交于
      The LPT may have gaps in it because initially empty LEBs
      are not added by mkfs.ubifs - because it does not know how
      many there are.  Then UBIFS allocates empty LEBs in the
      reverse order that they are discovered i.e. they are
      added to, and removed from, the front of a list.  That
      creates a gap in the middle of the LPT.
      
      The function dirtying the LPT tree (for the purpose of
      small model garbage collection) assumed that a gap could
      only occur at the very end of the LPT and stopped dirtying
      prematurely, which in turn resulted in the LPT running
      out of space - something that is designed to be impossible.
      Signed-off-by: NAdrian Hunter <ext-adrian.hunter@nokia.com>
      7e2d9bfa
  15. 30 9月, 2008 2 次提交
    • A
      UBIFS: check buffer length when scanning for LPT nodes · be2f6bd6
      Adrian Hunter 提交于
      'is_a_node()' function was reading from a buffer before
      checking the buffer length, resulting in an OOPS as
      follows:
      
      BUG: unable to handle kernel paging request at f8f74002
      IP: [<f8f9783f>] :ubifs:ubifs_unpack_bits+0xca/0x233
      *pde = 19e95067 *pte = 00000000
      Oops: 0000 [#1] PREEMPT SMP
      Modules linked in: ubifs ubi mtdchar bio2mtd mtd brd video output
      [last unloaded: mtd]
      
      Pid: 6414, comm: integck Not tainted (2.6.27-rc6ubifs34 #23)
      EIP: 0060:[<f8f9783f>] EFLAGS: 00010246 CPU: 0
      EIP is at ubifs_unpack_bits+0xca/0x233 [ubifs]
      EAX: 00000000 EBX: f6090630 ECX: d9badcfc EDX: 00000000
      ESI: 00000004 EDI: f8f74002 EBP: d9badcec ESP: d9badcc0
       DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
      Process integck (pid: 6414, ti=d9bac000 task=f727dae0 task.ti=d9bac000)
      Stack: 00000006 f7306240 00000002 00000000 d9badcfc d9badd00 0000001c 00000000
             f6090630 f6090630 f8f74000 d9badd10 f8fa1cc9 00000000 f8f74002 00000000
             f8f74002 f60fe128 f6090630 f8f74000 d9badd68 f8fa1e46 00000000 0001e000
      Call Trace:
       [<f8fa1cc9>] ? is_a_node+0x30/0x90 [ubifs]
       [<f8fa1e46>] ? dbg_check_ltab+0x11d/0x5bd [ubifs]
       [<f8fa388f>] ? ubifs_lpt_start_commit+0x42/0xed3 [ubifs]
       [<c038e76a>] ? mutex_unlock+0x8/0xa
       [<f8f9625d>] ? ubifs_tnc_start_commit+0x1c8/0xedb [ubifs]
       [<f8f8d90b>] ? do_commit+0x187/0x523 [ubifs]
       [<c038e76a>] ? mutex_unlock+0x8/0xa
       [<f8f7ca17>] ? bud_wbuf_callback+0x22/0x28 [ubifs]
       [<f8f8dd1d>] ? ubifs_run_commit+0x76/0xc0 [ubifs]
       [<f8f8032c>] ? ubifs_sync_fs+0xd2/0xe6 [ubifs]
       [<c01a2e97>] ? vfs_quota_sync+0x0/0x17e
       [<c01a5ba6>] ? quota_sync_sb+0x26/0xbb
       [<c01a2e97>] ? vfs_quota_sync+0x0/0x17e
       [<c01a5c5d>] ? sync_dquots+0x22/0x12c
       [<c0173d1b>] ? __fsync_super+0x19/0x68
       [<c0173d75>] ? fsync_super+0xb/0x19
       [<c0174065>] ? generic_shutdown_super+0x22/0xe7
       [<c01a31fc>] ? vfs_quota_off+0x0/0x5fd
       [<f8f7cf4d>] ? ubifs_kill_sb+0x31/0x35 [ubifs]
       [<c01741f9>] ? deactivate_super+0x5e/0x71
       [<c0187610>] ? mntput_no_expire+0x82/0xe4
       [<c0187905>] ? sys_umount+0x4c/0x2f6
       [<c0187bc8>] ? sys_oldumount+0x19/0x1b
       [<c0103b71>] ? sysenter_do_call+0x12/0x25
       =======================
      Code: c1 f8 03 8d 04 07 8b 4d e8 89 01 8b 45 e4 89 10 89 d8 89 f1 d3 e8 85 c0
            74 07 29 d6 83 fe 20 75 2a 89 d8 83 c4 20 5b 5e 5f 5d
      EIP: [<f8f9783f>] ubifs_unpack_bits+0xca/0x233 [ubifs] SS:ESP 0068:d9badcc0
      ---[ end trace 1f02572436518c13 ]---
      Signed-off-by: NAdrian Hunter <ext-adrian.hunter@nokia.com>
      be2f6bd6
    • A
      UBIFS: add more debugging messages for LPT · 73944a6d
      Adrian Hunter 提交于
      Also add debugging checks for LPT size and separate
      out c->check_lpt_free from unrelated bitfields.
      Signed-off-by: NAdrian Hunter <ext-adrian.hunter@nokia.com>
      73944a6d
  16. 15 7月, 2008 1 次提交