02 May, 2007

1 commit


28 Apr, 2007

1 commit


27 Apr, 2007

1 commit


26 Apr, 2007

2 commits


25 Apr, 2007

3 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
     
  • No need to check for all-zero header since the header cannot
    be zero due to other checks.

    Replace the all-zero header check in readinode.c with a
    check for the magic word.

    Signed-off-by: Joakim Tjernlund
    Signed-off-by: David Woodhouse

    Joakim Tjernlund
     
  • 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

2 commits

  • We should never find the unchecked size is non-zero after we've finished
    checking all inodes. If it happens, used to BUG(), leaving the alloc_sem
    held and deadlocking. Instead, just return -ENOSPC after complaining. The
    GC thread will die, but read-only operation should be able to continue and
    the file system should be unmountable.

    Signed-off-by: David Woodhouse

    David Woodhouse
     
  • 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 Apr, 2007

1 commit


18 Apr, 2007

6 commits

  • Remove excessive scanning of empty flash after a clean
    marker for users of the point/unpoint method. cfi_cmdset_0001
    uses point/unpoint by default iff flash mapping is linear.
    The speedup is several orders of magnitude if FS is less than
    half full.

    Signed-off-by: Joakim Tjernlund
    Signed-off-by: David Woodhouse

    Joakim Tjernlund
     
  • In read inode we have an optimization which prevents one
    min. I/O unit (e.g. NAND page) to be read more then once.

    Namely, at the beginning we do not know which node type we read,
    so we read so we assume we read the directory entry, because it
    has the smallest node header. When we read it, we read up to the
    next min. I/O unit, just because if later we'll need to read more,
    we already have this data.

    If it turns out to be that the node is not directory entry, and
    we need more data, and we did not read it because it sits in the
    next min. I/O unit, we read the whole next (or several next)
    min. I/O unit(s). And if it happens to be that we read a data node,
    and we've read part of its data, we calculate partial CRC.
    So if later we need to check data CRC, we'll only read the rest
    of the data from further min. I/O units and continue CRC checking.

    This code was a bit messy and buggy. The bug was that it assumed
    relatively large min. I/O unit, so that the largest node header
    could overlap only one min. I/O unit boundary.

    This parch clean-ups the code a bit and fixes this bug.
    The patch was not tested on flash with small min. I/O unit, like
    NOR-ECC, nut it was tested on NAND with 512 bytes NAND page, so
    it at least does not break NAND. It was also tested with mtdram
    so it should not break NOR.

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

    Artem Bityutskiy
     
  • After a write error, any data in the write buffer must
    be relocated. This is handled by the jffs2_wbuf_recover
    function. This function does not fix up the erase block
    summary information that is collected for writing at the
    end of the block, which results in an incorrect summary
    (or BUG if the summary was found to be empty).

    As the summary is not essential (it is an optimisation),
    it may be disabled for the current erase block when this
    situation arises. This patch does that.

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

    Adrian Hunter
     
  • If a write error occurs, the affected block is placed on the
    bad_used_list. In the case that the write error occured
    when writing summary data the block was also being placed on
    the dirty_list, which caused list corruption and ultimately
    a soft lockup in jffs2_mark_node_obsolete. This fixes that.

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

    Adrian Hunter
     
  • When the MTD driver returns write failure, the following deadlock
    occurs:

    We are in __jffs2_flush_wbuf(), we hold &c->wbuf_sem. Write failure.
    jffs2_wbuf_recover()->jffs2_reserve_space_gc()->jffs2_do_reserve_space()
    ->jffs2_erase_pending_blocks()->jffs2_flash_read()

    and it tries to lock &c->wbuf_sem again. Deadlock.

    Reported-by: Adrian Hunter
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Artem Bityutskiy
     
  • Check the node CRC on scan before doing anything else with the node.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: David Woodhouse

    Thomas Gleixner
     

03 Apr, 2007

1 commit


10 Mar, 2007

1 commit


09 Mar, 2007

2 commits


08 Mar, 2007

2 commits

  • The garbage collection thread is strictly an optimisation. Everything it
    does would also be done just-in-time in the context of something in
    userspace trying to access the file system.

    Sometimes, however, it's a pessimisation. Especially during early boot
    when it's checksumming nodes and scanning inodes which are shortly going
    to be pulled in by read_inode anyway. We end up building the rbtree of
    node coverage twice for the same inode.

    By switching to yield() instead of cond_resched() in the main loop, we
    observe boot times on the OLPC system going down from about 100 seconds to
    60.

    Signed-off-by: David Woodhouse

    David Woodhouse
     
  • For the case when nand_write_page fail with -EIO for the first page in an
    eraseblock, jffs2_wbuf_recover ends up producing a BUG in jffs2_block_refile
    as jeb->first_node is not yet set up (it's set up later in jffs2_wbuf_recover).
    This BUG is not really a bug; it's just jffs2_wbuf_recover calling
    jffs2_block_refile with the wrong second parameter.
    This patch takes care of this situation.

    Signed-off-by: Vitaly Wool
    Signed-off-by: Thomas Gleixner
    Signed-off-by: David Woodhouse

    Vitaly Wool
     

20 Feb, 2007

1 commit

  • * git://git.infradead.org/mtd-2.6: (49 commits)
    [MTD] [NAND] S3C2412 fix hw ecc
    [MTD] [NAND] Work around false compiler warning in CAFÉ driver
    [JFFS2] printk warning fixes
    [MTD] [MAPS] ichxrom warning fix
    [MTD] [MAPS] amd76xrom warning fix
    [MTD] [MAPS] esb2rom warning fixes
    [MTD] [MAPS] ck804xrom warning fix
    [MTD] [MAPS] netsc520 warning fix
    [MTD] [MAPS] sc520cdp warning fix
    [MTD] [ONENAND] onenand_base warning fix
    [MTD] [NAND] eXcite nand flash driver
    [MTD] Improve heuristic for detecting wrong-endian RedBoot partition table
    [MTD] Fix RedBoot partition parsing regression harder.
    [MTD] [NAND] S3C2410: Hardware ECC correction code
    [JFFS2] Use MTD_OOB_AUTO to automatically place cleanmarker on NAND
    [MTD] Clarify OOB-operation interface comments
    [MTD] remove unused ecctype,eccsize fields from struct mtd_info
    [MTD] [NOR] Intel: remove ugly PROGREGION macros
    [MTD] [NOR] STAA: use writesize instead off eccsize to represent ECC block
    [MTD] OneNAND: Invalidate bufferRAM after erase
    ...

    Linus Torvalds
     

19 Feb, 2007

1 commit

  • fs/jffs2/wbuf.c: In function 'jffs2_check_oob_empty':
    fs/jffs2/wbuf.c:993: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
    fs/jffs2/wbuf.c:993: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
    fs/jffs2/wbuf.c: In function 'jffs2_check_nand_cleanmarker':
    fs/jffs2/wbuf.c:1036: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
    fs/jffs2/wbuf.c:1036: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
    fs/jffs2/wbuf.c: In function 'jffs2_write_nand_cleanmarker':
    fs/jffs2/wbuf.c:1062: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
    fs/jffs2/wbuf.c:1062: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'

    Signed-off-by: Andrew Morton
    Signed-off-by: David Woodhouse

    Andrew Morton
     

15 Feb, 2007

1 commit

  • After Al Viro (finally) succeeded in removing the sched.h #include in module.h
    recently, it makes sense again to remove other superfluous sched.h includes.
    There are quite a lot of files which include it but don't actually need
    anything defined in there. Presumably these includes were once needed for
    macros that used to live in sched.h, but moved to other header files in the
    course of cleaning it up.

    To ease the pain, this time I did not fiddle with any header files and only
    removed #includes from .c-files, which tend to cause less trouble.

    Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
    arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
    allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
    configs in arch/arm/configs on arm. I also checked that no new warnings were
    introduced by the patch (actually, some warnings are removed that were emitted
    by unnecessarily included header files).

    Signed-off-by: Tim Schmielau
    Acked-by: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tim Schmielau
     

13 Feb, 2007

2 commits

  • This patch is inspired by Arjan's "Patch series to mark struct
    file_operations and struct inode_operations const".

    Compile tested with gcc & sparse.

    Signed-off-by: Josef 'Jeff' Sipek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Josef 'Jeff' Sipek
     
  • Many struct inode_operations in the kernel can be "const". Marking them const
    moves these to the .rodata section, which avoids false sharing with potential
    dirty data. In addition it'll catch accidental writes at compile time to
    these shared resources.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

09 Feb, 2007

2 commits

  • Nowadays MTD supports an MTD_OOB_AUTO option which allows users
    to access free bytes in NAND's OOB as a contiguous buffer, although
    it may be highly discontinuous.

    This patch teaches JFFS2 to use this nice feature instead of the
    old MTD_OOB_PLACE option. This for example caused problems with
    OneNAND. Now JFFS2 does not care how are the free bytes situated.

    This may change position of the clean marker on some flashes,
    but this is not a problem. JFFS2 will just re-erase the empty
    eraseblocks and write the new (correct) clean marker.

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

    Artem Bityutskiy
     
  • If jffs2_sum_init() fails, c->blocks is not freed neither in
    jffs2_do_mount_fs() nor in jffs2_do_fill_super().

    Signed-off-by: Dmitry Adamushko
    Signed-off-by: David Woodhouse

    Dmitry Adamushko
     

18 Jan, 2007

1 commit


13 Jan, 2007

1 commit


10 Jan, 2007

2 commits


03 Jan, 2007

1 commit


19 Dec, 2006

1 commit


10 Dec, 2006

1 commit


09 Dec, 2006

1 commit


08 Dec, 2006

2 commits

  • Move process freezing functions from include/linux/sched.h to freezer.h, so
    that modifications to the freezer or the kernel configuration don't require
    recompiling just about everything.

    [akpm@osdl.org: fix ueagle driver]
    Signed-off-by: Nigel Cunningham
    Cc: "Rafael J. Wysocki"
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nigel Cunningham
     
  • Replace all uses of kmem_cache_t with struct kmem_cache.

    The patch was generated using the following script:

    #!/bin/sh
    #
    # Replace one string by another in all the kernel sources.
    #

    set -e

    for file in `find * -name "*.c" -o -name "*.h"|xargs grep -l $1`; do
    quilt add $file
    sed -e "1,\$s/$1/$2/g" $file >/tmp/$$
    mv /tmp/$$ $file
    quilt refresh
    done

    The script was run like this

    sh replace kmem_cache_t "struct kmem_cache"

    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter