27 Jul, 2007

1 commit


20 Jul, 2007

1 commit

  • Slab destructors were no longer supported after Christoph's
    c59def9f222d44bb7e2f0a559f2906191a0862d7 change. They've been
    BUGs for both slab and slub, and slob never supported them
    either.

    This rips out support for the dtor pointer from kmem_cache_create()
    completely and fixes up every single callsite in the kernel (there were
    about 224, not including the slab allocator definitions themselves,
    or the documentation references).

    Signed-off-by: Paul Mundt

    Paul Mundt
     

18 Jul, 2007

2 commits

  • Introduce is_owner_or_cap() macro in fs.h, and convert over relevant
    users to it. This is done because we want to avoid bugs in the future
    where we check for only effective fsuid of the current task against a
    file's owning uid, without simultaneously checking for CAP_FOWNER as
    well, thus violating its semantics.
    [ XFS uses special macros and structures, and in general looked ...
    untouchable, so we leave it alone -- but it has been looked over. ]

    The (current->fsuid != inode->i_uid) check in generic_permission() and
    exec_permission_lite() is left alone, because those operations are
    covered by CAP_DAC_OVERRIDE and CAP_DAC_READ_SEARCH. Similarly operations
    falling under the purview of CAP_CHOWN and CAP_LEASE are also left alone.

    Signed-off-by: Satyam Sharma
    Cc: Al Viro
    Acked-by: Serge E. Hallyn
    Signed-off-by: Linus Torvalds

    Satyam Sharma
     
  • currently the export_operation structure and helpers related to it are in
    fs.h. fs.h is already far too large and there are very few places needing the
    export bits, so split them off into a separate header.

    [akpm@linux-foundation.org: fix cifs build]
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Neil Brown
    Cc: Steven French
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

17 Jul, 2007

1 commit

  • Some users have been having problems with utilities like cp or dd dumping
    core when they try to copy a file that's too large for the destination
    filesystem (typically, > 4gb). Apparently, some defunct standards required
    SIGXFSZ to be sent in such circumstances, but SUS only requires/allows it
    for when a written file exceeds the process's resource limits. I'd like to
    limit SIGXFSZs to the bare minimum required by SUS.

    Patch sent per http://lkml.org/lkml/2007/4/10/302

    Signed-off-by: Micah Cowan
    Acked-by: Alan Cox
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Micah Cowan
     

10 Jul, 2007

1 commit


24 May, 2007

1 commit


17 May, 2007

1 commit

  • SLAB_CTOR_CONSTRUCTOR is always specified. No point in checking it.

    Signed-off-by: Christoph Lameter
    Cc: David Howells
    Cc: Jens Axboe
    Cc: Steven French
    Cc: Michael Halcrow
    Cc: OGAWA Hirofumi
    Cc: Miklos Szeredi
    Cc: Steven Whitehouse
    Cc: Roman Zippel
    Cc: David Woodhouse
    Cc: Dave Kleikamp
    Cc: Trond Myklebust
    Cc: "J. Bruce Fields"
    Cc: Anton Altaparmakov
    Cc: Mark Fasheh
    Cc: Paul Mackerras
    Cc: Christoph Hellwig
    Cc: Jan Kara
    Cc: David Chinner
    Cc: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

10 May, 2007

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: (25 commits)
    sound: convert "sound" subdirectory to UTF-8
    MAINTAINERS: Add cxacru website/mailing list
    include files: convert "include" subdirectory to UTF-8
    general: convert "kernel" subdirectory to UTF-8
    documentation: convert the Documentation directory to UTF-8
    Convert the toplevel files CREDITS and MAINTAINERS to UTF-8.
    remove broken URLs from net drivers' output
    Magic number prefix consistency change to Documentation/magic-number.txt
    trivial: s/i_sem /i_mutex/
    fix file specification in comments
    drivers/base/platform.c: fix small typo in doc
    misc doc and kconfig typos
    Remove obsolete fat_cvf help text
    Fix occurrences of "the the "
    Fix minor typoes in kernel/module.c
    Kconfig: Remove reference to external mqueue library
    Kconfig: A couple of grammatical fixes in arch/i386/Kconfig
    Correct comments in genrtc.c to refer to correct /proc file.
    Fix more "deprecated" spellos.
    Fix "deprecated" typoes.
    ...

    Fix trivial comment conflict in kernel/relay.c.

    Linus Torvalds
     
  • Use zero_user_page() instead of open-coding it.

    Signed-off-by: Nate Diller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nate Diller
     

09 May, 2007

6 commits


08 May, 2007

2 commits

  • I have never seen a use of SLAB_DEBUG_INITIAL. It is only supported by
    SLAB.

    I think its purpose was to have a callback after an object has been freed
    to verify that the state is the constructor state again? The callback is
    performed before each freeing of an object.

    I would think that it is much easier to check the object state manually
    before the free. That also places the check near the code object
    manipulation of the object.

    Also the SLAB_DEBUG_INITIAL callback is only performed if the kernel was
    compiled with SLAB debugging on. If there would be code in a constructor
    handling SLAB_DEBUG_INITIAL then it would have to be conditional on
    SLAB_DEBUG otherwise it would just be dead code. But there is no such code
    in the kernel. I think SLUB_DEBUG_INITIAL is too problematic to make real
    use of, difficult to understand and there are easier ways to accomplish the
    same effect (i.e. add debug code before kfree).

    There is a related flag SLAB_CTOR_VERIFY that is frequently checked to be
    clear in fs inode caches. Remove the pointless checks (they would even be
    pointless without removeal of SLAB_DEBUG_INITIAL) from the fs constructors.

    This is the last slab flag that SLUB did not support. Remove the check for
    unimplemented flags from SLUB.

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

    Christoph Lameter
     
  • Ensure pages are uptodate after returning from read_cache_page, which allows
    us to cut out most of the filesystem-internal PageUptodate calls.

    I didn't have a great look down the call chains, but this appears to fixes 7
    possible use-before uptodate in hfs, 2 in hfsplus, 1 in jfs, a few in
    ecryptfs, 1 in jffs2, and a possible cleared data overwritten with readpage in
    block2mtd. All depending on whether the filler is async and/or can return
    with a !uptodate page.

    Signed-off-by: Nick Piggin
    Cc: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

01 May, 2007

1 commit

  • We're getting lockdep warnings due to a post-2.6.21-rc7 bugfix.

    The xattr_sem can never be taken in the manner described. Internal inodes
    are protected by I_PRIVATE. Add the appropriate annotation.

    Cc:
    Cc: "Antonino A. Daplas"
    Cc: Takashi Iwai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     

24 Apr, 2007

1 commit

  • The listxattr() and getxattr() operations are only protected by a read
    lock. As a result, if either of these operations run in parallel, a race
    condition exists where the xattr_root will end up being cached twice, which
    results in the leaking of a reference and a BUG() on umount.

    This patch refactors get_xa_root(), __get_xa_root(), and create_xa_root(),
    into one get_xa_root() function that takes the appropriate locking around
    the entire critical section.

    Reported, diagnosed and tested by Andrea Righi

    Signed-off-by: Jeff Mahoney
    Cc: Andrea Righi
    Cc: "Vladimir V. Saveliev"
    Cc: Edward Shishkin
    Cc: Alex Zarochentsev
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     

13 Apr, 2007

1 commit

  • This patch fixes a bug in function decrementing a key of stat data item.

    Offset of reiserfs keys are compared as signed values. To set key offset
    to maximal possible value maximal signed value has to be used.

    This bug is responsible for severe reiserfs filesystem corruption which
    shows itself as warning vs-13060. reiserfsck fixes this corruption by
    filesystem tree rebuilding.

    Signed-off-by: Vladimir Saveliev
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vladimir Saveliev
     

13 Feb, 2007

3 commits


23 Jan, 2007

1 commit

  • This patch fixes a confusion reiserfs has for a long time.

    On release file operation reiserfs used to try to pack file data stored in
    last incomplete page of some files into metadata blocks. After packing the
    page got cleared with clear_page_dirty. It did not take into account that
    the page may be mmaped into other process's address space. Recent
    replacement for clear_page_dirty cancel_dirty_page found the confusion with
    sanity check that page has to be not mapped.

    The patch fixes the confusion by making reiserfs avoid tail packing if an
    inode was ever mmapped. reiserfs_mmap and reiserfs_file_release are
    serialized with mutex in reiserfs specific inode. reiserfs_mmap locks the
    mutex and sets a bit in reiserfs specific inode flags.
    reiserfs_file_release checks the bit having the mutex locked. If bit is
    set - tail packing is avoided. This eliminates a possibility that mmapped
    page gets cancel_page_dirty-ed.

    Signed-off-by: Vladimir Saveliev
    Cc: Jeff Mahoney
    Cc: Chris Mason
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vladimir Saveliev
     

24 Dec, 2006

1 commit


14 Dec, 2006

1 commit

  • Run this:

    #!/bin/sh
    for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do
    echo "De-casting $f..."
    perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f
    done

    And then go through and reinstate those cases where code is casting pointers
    to non-pointers.

    And then drop a few hunks which conflicted with outstanding work.

    Cc: Russell King , Ian Molton
    Cc: Mikael Starvik
    Cc: Yoshinori Sato
    Cc: Roman Zippel
    Cc: Geert Uytterhoeven
    Cc: Ralf Baechle
    Cc: Paul Mackerras
    Cc: Kyle McMartin
    Cc: Benjamin Herrenschmidt
    Cc: Martin Schwidefsky
    Cc: "David S. Miller"
    Cc: Jeff Dike
    Cc: Greg KH
    Cc: Jens Axboe
    Cc: Paul Fulghum
    Cc: Alan Cox
    Cc: Karsten Keil
    Cc: Mauro Carvalho Chehab
    Cc: Jeff Garzik
    Cc: James Bottomley
    Cc: Ian Kent
    Cc: Steven French
    Cc: David Woodhouse
    Cc: Neil Brown
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     

09 Dec, 2006

3 commits


08 Dec, 2006

6 commits

  • We add a save link for O_DIRECT writes to protect the i_size against the
    crashes before we actually finish the I/O. If we hit an -ENOSPC in
    aops->prepare_write(), we would do a truncate() to release the blocks which
    might have got initialized. Now the truncate would add another save link
    for the same inode causing a reiserfs panic for having multiple save links
    for the same inode.

    Signed-off-by: Vladimir V. Saveliev
    Signed-off-by: Amit Arora
    Signed-off-by: Suzuki K P
    Cc: Jeff Mahoney
    Cc: Chris Mason
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vladimir V. Saveliev
     
  • Replace kmalloc+memset with kzalloc

    Signed-off-by: Yan Burman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yan Burman
     
  • Looks like, reiserfs_prepare_file_region_for_write() doesn't contain
    several flush_dcache_page() calls.

    Found with help from Dmitriy Monakhov

    [akpm@osdl.org: small speedup]
    Signed-off-by: Alexey Dobriyan
    Cc: Dmitriy Monakhov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • One of our test team hit a reiserfs_panic while running fsstress tests on
    2.6.19-rc1. The message looks like :

    REISERFS: panic(device Null superblock):
    reiserfs[5676]: assertion !(p->path_length != 1 ) failed at
    fs/reiserfs/stree.c:397:reiserfs_check_path: path not properly relsed.

    The backtrace looked :

    kernel BUG in reiserfs_panic at fs/reiserfs/prints.c:361!
    .reiserfs_check_path+0x58/0x74
    .reiserfs_get_block+0x1444/0x1508
    .__block_prepare_write+0x1c8/0x558
    .block_prepare_write+0x34/0x64
    .reiserfs_prepare_write+0x118/0x1d0
    .generic_file_buffered_write+0x314/0x82c
    .__generic_file_aio_write_nolock+0x350/0x3e0
    .__generic_file_write_nolock+0x78/0xb0
    .generic_file_write+0x60/0xf0
    .reiserfs_file_write+0x198/0x2038
    .vfs_write+0xd0/0x1b4
    .sys_write+0x4c/0x8c
    syscall_exit+0x0/0x4

    Upon debugging I found that the restart_transaction was not releasing
    the path if the th->refcount was > 1.

    /*static*/
    int restart_transaction(struct reiserfs_transaction_handle *th,
    struct inode *inode, struct path *path)
    {
    [...]

    /* we cannot restart while nested */
    if (th->t_refcount > 1) { <<i_sb)->j_next_async_flush = 1;

    -->> retval = restart_transaction(th, inode, &path); <refcount is > 1, the path is still valid. And,

    if (retval)
    goto failure;
    repeat =
    _allocate_block(th, block, inode,
    &allocated_block_nr, NULL, create);

    If the above allocate_block fails with NO_DISK_SPACE or QUOTA_EXCEEDED,
    we would have path which is not released.

    if (repeat != NO_DISK_SPACE && repeat != QUOTA_EXCEEDED) {
    goto research;
    }
    if (repeat == QUOTA_EXCEEDED)
    retval = -EDQUOT;
    else
    retval = -ENOSPC;
    goto failure;
    [...]

    failure:
    [...]
    reiserfs_check_path(&path); << Panics here !

    Attached here is a patch which could fix the issue.

    fix reiserfs/inode.c : restart_transaction() to release the path in all
    cases.

    The restart_transaction() doesn't release the path when the the journal
    handle has a refcount > 1. This would trigger a reiserfs_panic() if we
    encounter an -ENOSPC / -EDQUOT in reiserfs_get_block().

    Signed-off-by: Suzuki K P
    Cc: "Vladimir V. Saveliev"
    Cc:
    Cc: Jeff Mahoney
    Acked-by: Jan Kara
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Suzuki K P
     
  • 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
     
  • SLAB_KERNEL is an alias of GFP_KERNEL.

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

    Christoph Lameter
     

05 Dec, 2006

1 commit


03 Dec, 2006

1 commit


30 Nov, 2006

1 commit


26 Nov, 2006

1 commit