11 Mar, 2014

1 commit

  • mounting JFFS2 partition sometimes crashes with this call trace:

    [ 1322.240000] Kernel bug detected[#1]:
    [ 1322.244000] Cpu 2
    [ 1322.244000] $ 0 : 0000000000000000 0000000000000018 000000003ff00070 0000000000000001
    [ 1322.252000] $ 4 : 0000000000000000 c0000000f3980150 0000000000000000 0000000000010000
    [ 1322.260000] $ 8 : ffffffffc09cd5f8 0000000000000001 0000000000000088 c0000000ed300de8
    [ 1322.268000] $12 : e5e19d9c5f613a45 ffffffffc046d464 0000000000000000 66227ba5ea67b74e
    [ 1322.276000] $16 : c0000000f1769c00 c0000000ed1e0200 c0000000f3980150 0000000000000000
    [ 1322.284000] $20 : c0000000f3a80000 00000000fffffffc c0000000ed2cfbd8 c0000000f39818f0
    [ 1322.292000] $24 : 0000000000000004 0000000000000000
    [ 1322.300000] $28 : c0000000ed2c0000 c0000000ed2cfab8 0000000000010000 ffffffffc039c0b0
    [ 1322.308000] Hi : 000000000000023c
    [ 1322.312000] Lo : 000000000003f802
    [ 1322.316000] epc : ffffffffc039a9f8 check_tn_node+0x88/0x3b0
    [ 1322.320000] Not tainted
    [ 1322.324000] ra : ffffffffc039c0b0 jffs2_do_read_inode_internal+0x1250/0x1e48
    [ 1322.332000] Status: 5400f8e3 KX SX UX KERNEL EXL IE
    [ 1322.336000] Cause : 00800034
    [ 1322.340000] PrId : 000c1004 (Netlogic XLP)
    [ 1322.344000] Modules linked in:
    [ 1322.348000] Process jffs2_gcd_mtd7 (pid: 264, threadinfo=c0000000ed2c0000, task=c0000000f0e68dd8, tls=0000000000000000)
    [ 1322.356000] Stack : c0000000f1769e30 c0000000ed010780 c0000000ed010780 c0000000ed300000
    c0000000f1769c00 c0000000f3980150 c0000000f3a80000 00000000fffffffc
    c0000000ed2cfbd8 ffffffffc039c0b0 ffffffffc09c6340 0000000000001000
    0000000000000dec ffffffffc016c9d8 c0000000f39805a0 c0000000f3980180
    0000008600000000 0000000000000000 0000000000000000 0000000000000000
    0001000000000dec c0000000f1769d98 c0000000ed2cfb18 0000000000010000
    0000000000010000 0000000000000044 c0000000f3a80000 c0000000f1769c00
    c0000000f3d207a8 c0000000f1769d98 c0000000f1769de0 ffffffffc076f9c0
    0000000000000009 0000000000000000 0000000000000000 ffffffffc039cf90
    0000000000000017 ffffffffc013fbdc 0000000000000001 000000010003e61c
    ...
    [ 1322.424000] Call Trace:
    [ 1322.428000] [] check_tn_node+0x88/0x3b0
    [ 1322.432000] [] jffs2_do_read_inode_internal+0x1250/0x1e48
    [ 1322.440000] [] jffs2_do_crccheck_inode+0x70/0xd0
    [ 1322.448000] [] jffs2_garbage_collect_pass+0x160/0x870
    [ 1322.452000] [] jffs2_garbage_collect_thread+0xdc/0x1f0
    [ 1322.460000] [] kthread+0xb8/0xc0
    [ 1322.464000] [] kernel_thread_helper+0x10/0x18
    [ 1322.472000]
    [ 1322.472000]
    Code: 67bd0050 94a4002c 2c830001 de050218 2403fffc 0080a82d 00431824 24630044
    [ 1322.480000] ---[ end trace b052bb90e97dfbf5 ]---

    The variable csize in structure jffs2_tmp_dnode_info is of type uint16_t, but it
    is used to hold the compressed data length(csize) which is declared as uint32_t.
    So, when the value of csize exceeds 16bits, it gets truncated when assigned to
    tn->csize. This is causing a kernel BUG.
    Changing the definition of csize in jffs2_tmp_dnode_info to uint32_t fixes the issue.

    Signed-off-by: Ajesh Kunhipurayil Vijayan
    Signed-off-by: Kamlakant Patel
    Cc:
    Signed-off-by: Brian Norris

    Ajesh Kunhipurayil Vijayan
     

02 Feb, 2011

1 commit

  • SELinux would like to implement a new labeling behavior of newly created
    inodes. We currently label new inodes based on the parent and the creating
    process. This new behavior would also take into account the name of the
    new object when deciding the new label. This is not the (supposed) full path,
    just the last component of the path.

    This is very useful because creating /etc/shadow is different than creating
    /etc/passwd but the kernel hooks are unable to differentiate these
    operations. We currently require that userspace realize it is doing some
    difficult operation like that and than userspace jumps through SELinux hoops
    to get things set up correctly. This patch does not implement new
    behavior, that is obviously contained in a seperate SELinux patch, but it
    does pass the needed name down to the correct LSM hook. If no such name
    exists it is fine to pass NULL.

    Signed-off-by: Eric Paris

    Eric Paris
     

25 Oct, 2010

1 commit

  • When JFFS2 is used for large volumes, the mount times are quite long.
    Increasing the hash size provides a significant speed boost on the OLPC
    XO-1 laptop.

    Add logic that dynamically selects a hash size based on the size of
    the medium. A 64mb medium will result in a hash size of 128, and a 512mb
    medium will result in a hash size of 1024.

    Signed-off-by: Daniel Drake
    Signed-off-by: David Woodhouse

    Daniel Drake
     

09 Aug, 2010

1 commit


19 May, 2010

1 commit


25 Feb, 2010

1 commit


10 Jan, 2009

1 commit

  • 'rb_prev()', 'rb_next()' and 'rb_replace_node()' are declared in
    include/linux/rbtree.h, no need for JFFS2 to re-declare them. I
    believe these are left-overs from the old days when the common
    RB tree code did not have those call and JFFS2 had private
    implementation.

    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Artem Bityutskiy
     

02 May, 2008

1 commit


23 Apr, 2008

1 commit


10 Jul, 2007

1 commit


29 Jun, 2007

1 commit


26 Apr, 2007

1 commit


25 Apr, 2007

2 commits

  • In particular, remove the bit in the LICENCE file about contacting
    Red Hat for alternative arrangements. Their errant IS department broke
    that arrangement a long time ago -- the policy of collecting copyright
    assignments from contributors came to an end when the plug was pulled on
    the servers hosting the project, without notice or reason.

    We do still dual-license it for use with eCos, with the GPL+exception
    licence approved by the FSF as being GPL-compatible. It's just that nobody
    has the right to license it differently.

    Signed-off-by: David Woodhouse

    David Woodhouse
     
  • We originally used to read every node and allocate a jffs2_tmp_dnode_info
    structure for each, before processing them in (reverse) version order
    and discarding the ones which are obsoleted by later nodes.

    With huge logfiles, this behaviour caused memory problems. For example, a
    file involved in OLPC trac #1292 has 1822391 nodes, and would cause the XO
    machine to run out of memory during the first stage of read_inode().

    Instead of just inserting nodes into a tree in version order as we find
    them, we now put them into a tree in order of their offset within the
    file, which allows us to immediately discard nodes which are completely
    obsoleted.

    We don't use a full tree with 'fragments' pointing to the real data
    structure, as we do in the normal fragtree. We sort only on the start
    address, and add an 'overlapped' flag to the tmp_dnode_info to indicate
    that the node in question is (partially) overlapped by another.

    When the scan is complete, we start at the end of the file, adding each
    node to a real fragtree as before. Where the node is non-overlapped, we
    just add it (it doesn't matter that it's not the latest version; there is
    no overlap). When the node at the end of the tree _is_ overlapped, we sort
    it and all its overlapping nodes into version order and then add them to
    the fragtree in that order.

    This 'early discard' reduces the peak allocation of tmp_dnode_info
    structures from 1.8M to a mere 62872 (3.5%) in the degenerate case
    referenced above.

    This version of the patch also correctly rememembers the highest node
    version# seen for an inode when it's scanned.

    Signed-off-by: David Woodhouse

    David Woodhouse
     

23 Apr, 2007

1 commit

  • When compiling a LE-capable JFFS2 on PowerPC, wbuf.c fails to compile:

    fs/jffs2/wbuf.c:973: error: braced-group within expression allowed only inside a function
    fs/jffs2/wbuf.c:973: error: initializer element is not constant
    fs/jffs2/wbuf.c:973: error: (near initialization for ‘oob_cleanmarker.magic’)
    fs/jffs2/wbuf.c:974: error: braced-group within expression allowed only inside a function
    fs/jffs2/wbuf.c:974: error: initializer element is not constant
    fs/jffs2/wbuf.c:974: error: (near initialization for ‘oob_cleanmarker.nodetype’)
    fs/jffs2/wbuf.c:975: error: braced-group within expression allowed only inside a function
    fs/jffs2/wbuf.c:976: error: initializer element is not constant
    fs/jffs2/wbuf.c:976: error: (near initialization for ‘oob_cleanmarker.totlen’)

    Provide constant_cpu_to_je{16,32} functions, and use them for initialising the
    offending structure.

    Signed-off-by: David Woodhouse

    David Woodhouse
     

21 Oct, 2006

1 commit


07 Jul, 2006

1 commit


04 Jul, 2006

1 commit

  • * git://git.infradead.org/mtd-2.6:
    [JFFS2][XATTR] Fix memory leak in POSIX-ACL support
    fs/jffs2/: make 2 functions static
    [MTD] NAND: Fix broken sharpsl driver
    [JFFS2][XATTR] Fix xd->refcnt race condition
    MTD: kernel-doc fixes + additions
    MTD: fix all kernel-doc warnings
    [MTD] DOC: Fixup read functions and do a little cleanup

    Linus Torvalds
     

01 Jul, 2006

1 commit


30 Jun, 2006

1 commit


21 Jun, 2006

1 commit

  • * git://git.infradead.org/~dwmw2/rbtree-2.6:
    [RBTREE] Switch rb_colour() et al to en_US spelling of 'color' for consistency
    Update UML kernel/physmem.c to use rb_parent() accessor macro
    [RBTREE] Update hrtimers to use rb_parent() accessor macro.
    [RBTREE] Add explicit alignment to sizeof(long) for struct rb_node.
    [RBTREE] Merge colour and parent fields of struct rb_node.
    [RBTREE] Remove dead code in rb_erase()
    [RBTREE] Update JFFS2 to use rb_parent() accessor macro.
    [RBTREE] Update eventpoll.c to use rb_parent() accessor macro.
    [RBTREE] Update key.c to use rb_parent() accessor macro.
    [RBTREE] Update ext3 to use rb_parent() accessor macro.
    [RBTREE] Change rbtree off-tree marking in I/O schedulers.
    [RBTREE] Add accessor macros for colour and parent fields of rb_node

    Linus Torvalds
     

27 May, 2006

1 commit


25 May, 2006

2 commits


24 May, 2006

2 commits


23 May, 2006

1 commit


22 May, 2006

2 commits


21 May, 2006

7 commits


19 May, 2006

1 commit

  • Device node major/minor numbers are just stored in the payload of a single
    data node. Just extend that to 4 bytes and use new_encode_dev() for it.

    We only use the 4-byte format if we _need_ to, if !old_valid_dev(foo).
    This preserves backwards compatibility with older code as much as
    possible. If we do make devices with major or minor numbers above 255, and
    then mount the file system with the old code, it'll just read the first
    two bytes and get the numbers wrong. If it comes to garbage-collect it,
    it'll then write back those wrong numbers. But that's about the best we
    can expect.

    Signed-off-by: David Woodhouse

    David Woodhouse
     

13 May, 2006

2 commits

  • This patch can reduce 4-byte of memory usage per inode_cache.

    [4/10] jffs2-xattr-v5.1-04-remove_ilist_from_ic.patch

    Signed-off-by: KaiGai Kohei

    KaiGai Kohei
     
  • This attached patches provide xattr support including POSIX-ACL and
    SELinux support on JFFS2 (version.5).

    There are some significant differences from previous version posted
    at last December.
    The biggest change is addition of EBS(Erase Block Summary) support.
    Currently, both kernel and usermode utility (sumtool) can recognize
    xattr nodes which have JFFS2_NODETYPE_XATTR/_XREF nodetype.

    In addition, some bugs are fixed.
    - A potential race condition was fixed.
    - Unexpected fail when updating a xattr by same name/value pair was fixed.
    - A bug when removing xattr name/value pair was fixed.

    The fundamental structures (such as using two new nodetypes and exclusion
    mechanism by rwsem) are unchanged. But most of implementation were reviewed
    and updated if necessary.
    Espacially, we had to change several internal implementations related to
    load_xattr_datum() to avoid a potential race condition.

    [1/2] xattr_on_jffs2.kernel.version-5.patch
    [2/2] xattr_on_jffs2.utils.version-5.patch

    Signed-off-by: KaiGai Kohei
    Signed-off-by: David Woodhouse

    KaiGai Kohei
     

03 May, 2006

1 commit