04 Oct, 2015

1 commit


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

2 commits


31 Aug, 2012

2 commits


21 Aug, 2012

1 commit

  • This patch fixes a regression introduced by
    "4994297 UBIFS: make ubifs_lpt_init clean-up in case of failure" which
    I've hit while running the 'integck -p' test. When remount the file-system
    from R/O mode to R/W mode and 'lpt_init_wr()' fails, we free _all_ LPT
    resources by calling 'ubifs_lpt_free(c, 0)', even those needed for R/O
    mode. This leads to subsequent crashes, e.g., if we try to unmount
    the file-system.

    Cc: stable@vger.kernel.org [v3.5+]
    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     

21 May, 2012

2 commits

  • 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
     
  • Most functions in UBIFS follow the following designn pattern: if the function
    allocates multiple resources, and failss at some point, it frees what it has
    allocated and returns an error. So the caller can rely on the fact that the
    callee has cleaned up everything after own failure.

    Signed-off-by: Artem Bityutskiy
    Acked-by: Sidney Amani

    Artem Bityutskiy
     

17 May, 2012

4 commits


22 Nov, 2011

1 commit


04 Jul, 2011

4 commits


05 Apr, 2011

1 commit


07 Sep, 2010

1 commit


12 Jun, 2010

1 commit

  • Use ERR_CAST(x) rather than ERR_PTR(PTR_ERR(x)). The former makes more
    clear what is the purpose of the operation, which otherwise looks like a
    no-op.

    Signed-off-by: Julia Lawall
    Signed-off-by: Artem Bityutskiy

    Julia Lawall
     

30 Mar, 2010

1 commit

  • …it 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: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

23 Dec, 2008

1 commit


03 Dec, 2008

2 commits


19 Oct, 2008

1 commit

  • Fixes the following Oops:

    BUG: unable to handle kernel paging request at f8d24000
    IP: [] :ubifs:ubifs_unpack_bits+0xcd/0x231
    *pde = 34333067 *pte = 00000000
    Oops: 0000 [#1] PREEMPT SMP
    Modules linked in: deflate zlib_deflate lzo lzo_decompress lzo_compress
    ubifs ubi nandsim nand nand_ids nand_ecc mtd nfsd lockd sunrpc exportfs
    [last unloaded: nand_ecc]

    Pid: 7450, comm: sync Not tainted (2.6.27-rc8-ubifs-2.6 #27)
    EIP: 0060:[] EFLAGS: 00010206 CPU: 0
    EIP is at ubifs_unpack_bits+0xcd/0x231 [ubifs]
    EAX: 00000000 EBX: 00000000 ECX: d7e43dc0 EDX: 0000ff00
    ESI: 00000004 EDI: f8d23ffe EBP: d7e43db4 ESP: d7e43d8c
    DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Process sync (pid: 7450, ti=d7e42000 task=eb6f9530 task.ti=d7e42000)
    Stack: 00000400 c0103db4 dc5e8090 d7e43dc0 d7e43dc0 d7e43dc4 0000001c 00000004
    f496d1e0 f8d23ffc d7e43dd4 f8ffac7e f8d23ffe 00000000 f8d23ffe f2b7af68
    f496d1e0 f8d23ffc d7e43e2c f8ffadc5 00000000 0001f000 00000000 c03b10a7
    Call Trace:
    [] ? restore_nocheck_notrace+0x0/0xe
    [] ? is_a_node+0x43/0x92 [ubifs]
    [] ? dbg_check_ltab+0xf8/0x5c9 [ubifs]
    [] ? mutex_lock_nested+0x1b2/0x2a0
    [] ? ubifs_lpt_start_commit+0x49/0xecb [ubifs]
    [] ? mutex_unlock+0xd/0xf
    [] ? ubifs_tnc_start_commit+0x1cf/0xef8 [ubifs]
    [] ? do_commit+0x18f/0x52d [ubifs]
    [] ? ubifs_run_commit+0x80/0xca [ubifs]
    [] ? ubifs_sync_fs+0xdb/0xf6 [ubifs]
    [] ? sync_filesystems+0xc6/0x10c
    [] ? do_sync+0x3b/0x6a
    [] ? sys_sync+0x12/0x18
    [] ? sysenter_do_call+0x12/0x35
    =======================
    Code: 4d ec 89 01 8b 45 e8 89 10 89 d8 89 f1 d3 e8 85 c0 74 07 29 d6 83 fe
    20 75 2a 89 d8 83 c4 1c 5b 5e 5f 5d c3 0f b6 57 01 c1 e2 08 b6 47 02
    c1 e0 10 09 c2 0f b6 07 09 c2 0f b
    EIP: [] ubifs_unpack_bits+0xcd/0x231 [ubifs] SS:ESP 0068:d7e43d8c
    ---[ end trace 1bbb4c407a6dd816 ]---

    Signed-off-by: Adrian Hunter

    Adrian Hunter
     

30 Sep, 2008

1 commit


15 Jul, 2008

1 commit