30 Apr, 2008

2 commits

  • __FUNCTION__ is gcc-specific, use __func__

    Signed-off-by: Harvey Harrison
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Add a new BDI capability flag: BDI_CAP_NO_ACCT_WB. If this flag is
    set, then don't update the per-bdi writeback stats from
    test_set_page_writeback() and test_clear_page_writeback().

    Misc cleanups:

    - convert bdi_cap_writeback_dirty() and friends to static inline functions
    - create a flag that includes all three dirty/writeback related flags,
    since almst all users will want to have them toghether

    Signed-off-by: Miklos Szeredi
    Cc: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     

15 Feb, 2008

2 commits

  • * Add path_put() functions for releasing a reference to the dentry and
    vfsmount of a struct path in the right order

    * Switch from path_release(nd) to path_put(&nd->path)

    * Rename dput_path() to path_put_conditional()

    [akpm@linux-foundation.org: fix cifs]
    Signed-off-by: Jan Blunck
    Signed-off-by: Andreas Gruenbacher
    Acked-by: Christoph Hellwig
    Cc:
    Cc: Al Viro
    Cc: Steven French
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Blunck
     
  • This is the central patch of a cleanup series. In most cases there is no good
    reason why someone would want to use a dentry for itself. This series reflects
    that fact and embeds a struct path into nameidata.

    Together with the other patches of this series
    - it enforced the correct order of getting/releasing the reference count on
    pairs
    - it prepares the VFS for stacking support since it is essential to have a
    struct path in every place where the stack can be traversed
    - it reduces the overall code size:

    without patch series:
    text data bss dec hex filename
    5321639 858418 715768 6895825 6938d1 vmlinux

    with patch series:
    text data bss dec hex filename
    5320026 858418 715768 6894212 693284 vmlinux

    This patch:

    Switch from nd->{dentry,mnt} to nd->path.{dentry,mnt} everywhere.

    [akpm@linux-foundation.org: coding-style fixes]
    [akpm@linux-foundation.org: fix cifs]
    [akpm@linux-foundation.org: fix smack]
    Signed-off-by: Jan Blunck
    Signed-off-by: Andreas Gruenbacher
    Acked-by: Christoph Hellwig
    Cc: Al Viro
    Cc: Casey Schaufler
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Blunck
     

26 Jan, 2008

2 commits

  • configfs_register_subsystem() with default_groups triggers recursive locking.
    it seems that mutex_lock_nested is needed.

    =============================================
    [ INFO: possible recursive locking detected ]
    2.6.24-rc6 #145
    ---------------------------------------------
    swapper/1 is trying to acquire lock:
    (&sb->s_type->i_mutex_key#3){--..}, at: [] configfs_add_file+0x2e/0x70

    but task is already holding lock:
    (&sb->s_type->i_mutex_key#3){--..}, at: [] configfs_register_subsystem+0x55/0x130

    other info that might help us debug this:
    1 lock held by swapper/1:
    #0: (&sb->s_type->i_mutex_key#3){--..}, at: [] configfs_register_subsystem+0x55/0x130

    stack backtrace:
    Pid: 1, comm: swapper Not tainted 2.6.24-rc6 #145
    [] show_trace_log_lvl+0x1a/0x30
    [] show_trace+0x12/0x20
    [] dump_stack+0x6e/0x80
    [] __lock_acquire+0xe62/0x1120
    [] lock_acquire+0x82/0xa0
    [] mutex_lock_nested+0x98/0x2e0
    [] configfs_add_file+0x2e/0x70
    [] configfs_create_file+0x2c/0x40
    [] configfs_attach_item+0x139/0x220
    [] configfs_attach_group+0x14/0x140
    [] configfs_attach_group+0xc9/0x140
    [] configfs_register_subsystem+0xc6/0x130
    [] init_netconsole+0x2b6/0x300
    [] kernel_init+0x142/0x320
    [] kernel_thread_helper+0x7/0x14
    =======================

    Signed-off-by: Joonwoo Park
    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Joonwoo Park
     
  • configfs_register_subsystem() with default_groups triggers recursive locking.
    it seems that mutex_lock_nested is needed.

    =============================================
    [ INFO: possible recursive locking detected ]
    2.6.24-rc6 #141
    ---------------------------------------------
    swapper/1 is trying to acquire lock:
    (&sb->s_type->i_mutex_key#3){--..}, at: [] configfs_attach_group+0x4f/0x190

    but task is already holding lock:
    (&sb->s_type->i_mutex_key#3){--..}, at: [] configfs_register_subsystem+0x55/0x130

    other info that might help us debug this:
    1 lock held by swapper/1:
    #0: (&sb->s_type->i_mutex_key#3){--..}, at: [] configfs_register_subsystem+0x55/0x130

    stack backtrace:
    Pid: 1, comm: swapper Not tainted 2.6.24-rc6 #141
    [] show_trace_log_lvl+0x1a/0x30
    [] show_trace+0x12/0x20
    [] dump_stack+0x6e/0x80
    [] __lock_acquire+0xe62/0x1120
    [] lock_acquire+0x82/0xa0
    [] mutex_lock_nested+0x98/0x2e0
    [] configfs_attach_group+0x4f/0x190
    [] configfs_register_subsystem+0xc6/0x130
    [] init_netconsole+0x2b6/0x300
    [] kernel_init+0x142/0x320
    [] kernel_thread_helper+0x7/0x14
    =======================

    Signed-off-by: Joonwoo Park
    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Joonwoo Park
     

25 Jan, 2008

5 commits


17 Oct, 2007

3 commits

  • Why do we need r/o bind mounts?

    This feature allows a read-only view into a read-write filesystem. In the
    process of doing that, it also provides infrastructure for keeping track of
    the number of writers to any given mount.

    This has a number of uses. It allows chroots to have parts of filesystems
    writable. It will be useful for containers in the future because users may
    have root inside a container, but should not be allowed to write to
    somefilesystems. This also replaces patches that vserver has had out of the
    tree for several years.

    It allows security enhancement by making sure that parts of your filesystem
    read-only (such as when you don't trust your FTP server), when you don't want
    to have entire new filesystems mounted, or when you want atime selectively
    updated. I've been using the following script to test that the feature is
    working as desired. It takes a directory and makes a regular bind and a r/o
    bind mount of it. It then performs some normal filesystem operations on the
    three directories, including ones that are expected to fail, like creating a
    file on the r/o mount.

    This patch:

    Some filesystems forego the vfs and may_open() and create their own 'struct
    file's.

    This patch creates a couple of helper functions which can be used by these
    filesystems, and will provide a unified place which the r/o bind mount code
    may patch.

    Also, rename an existing, static-scope init_file() to a less generic name.

    Signed-off-by: Dave Hansen
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Hansen
     
  • provide BDI constructor/destructor hooks

    [akpm@linux-foundation.org: compile fix]
    Signed-off-by: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     
  • Implement new aops for some of the simpler filesystems.

    Signed-off-by: Nick Piggin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

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
     

11 Jul, 2007

7 commits

  • Sometimes other drivers depend on particular configfs items. For
    example, ocfs2 mounts depend on a heartbeat region item. If that
    region item is removed with rmdir(2), the ocfs2 mount must BUG or go
    readonly. Not happy.

    This provides two additional API calls: configfs_depend_item() and
    configfs_undepend_item(). A client driver can call
    configfs_depend_item() on an existing item to tell configfs that it is
    depended on. configfs will then return -EBUSY from rmdir(2) for that
    item. When the item is no longer depended on, the client driver calls
    configfs_undepend_item() on it.

    These API cannot be called underneath any configfs callbacks, as
    they will conflict. They can block and allocate. A client driver
    probably shouldn't calling them of its own gumption. Rather it should
    be providing an API that external subsystems call.

    How does this work? Imagine the ocfs2 mount process. When it mounts,
    it asks for a heart region item. This is done via a call into the
    heartbeat code. Inside the heartbeat code, the region item is looked
    up. Here, the heartbeat code calls configfs_depend_item(). If it
    succeeds, then heartbeat knows the region is safe to give to ocfs2.
    If it fails, it was being torn down anyway, and heartbeat can gracefully
    pass up an error.

    [ Fixed some bad whitespace in configfs.txt. --Mark ]

    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Joel Becker
     
  • Add a notification callback, ops->disconnect_notify(). It has the same
    prototype as ->drop_item(), but it will be called just before the item
    linkage is broken. This way, configfs users who want to do work while
    the object is still in the heirarchy have a chance.

    Client drivers will still need to config_item_put() in their
    ->drop_item(), if they implement it. They need do nothing in
    ->disconnect_notify(). They don't have to provide it if they don't
    care. But someone who wants to be notified before ci_parent is set to
    NULL can now be notified.

    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Joel Becker
     
  • Seems copied from sysfs, but I don't see a reason here nor there to use
    a semaphore instead of a mutex. Convert.

    Signed-off-by: Johannes Berg
    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Johannes Berg
     
  • Convert the su_sem member of struct configfs_subsystem to a struct
    mutex, as that's what it is. Also convert all the users and update
    Documentation/configfs.txt and Documentation/configfs_example.c
    accordingly.

    [ Conflict in fs/dlm/config.c with commit
    3168b0780d06ace875696f8a648d04d6089654e5 manually resolved. --Mark ]

    Inspired-by: Satyam Sharma
    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Joel Becker
     
  • Configfs being based upon sysfs code, config_group_find_obj() is probably
    so named because of the similar kset_find_obj() in sysfs. However,
    "kobject"s in sysfs become "config_item"s in configfs, so let's call it
    config_group_find_item() instead, for sake of uniformity, and make
    corresponding change in the users of this function.

    BTW a crucial difference between kset_find_obj and config_group_find_item
    is in locking expectations. kset_find_obj does its locking by itself, but
    config_group_find_item expects the *caller* to do the locking. The reason
    for this: kset's have their own locks, config_group's don't but instead
    rely on the subsystem mutex. And, subsystem needn't necessarily be around
    when config_group_find_item() is called.

    So let's state these locking semantics explicitly, and rectify the comment,
    otherwise bugs could continue to occur in future, as they did in the past
    (refer commit d82b8191e238 in gfs2-2.6-fixes.git).

    [ I also took the opportunity to fix some bad whitespace and
    double-empty lines. --Joel ]

    [ Conflict in fs/dlm/config.c with commit
    3168b0780d06ace875696f8a648d04d6089654e5 manually resolved. --Mark ]

    Signed-off-by: Satyam Sharma
    Cc: David Teigland
    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Satyam Sharma
     
  • 1. item.c:config_item_cleanup() is a private function (only called by
    config_item_release() in same file). However, it is spuriously
    exported in include/linux/configfs.h, so remove that export and make
    it static in item.c. Also, it is no longer exported / interface
    function, so no need to give comment for this function (the comment
    was stating obvious thing, anyway).

    2. Kernel-doc comment format does not allow empty line between end of
    comment and start of function (declaration line). There were several
    such spurious empty lines in item.c, so fix them.

    fs/configfs/item.c | 15 +++------------
    include/linux/configfs.h | 1 -
    2 files changed, 3 insertions(+), 13 deletions(-)

    Signed-off-by: Satyam Sharma
    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Satyam Sharma
     
  • The attribute store/show code currently limits attributes at PAGE_SIZE.
    This code comes from sysfs, where it still works that way.

    However, PAGE_SIZE is not constant. A 16k attribute string works on
    ia64 but not on x86. Really a subsystem shouldn't allow different
    attribute sizes based on platform.

    As such, limit all simple attributes to 4k. This works on all
    platforms, and is consistent with all current code.

    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Joel Becker
     

22 May, 2007

1 commit

  • First thing mm.h does is including sched.h solely for can_do_mlock() inline
    function which has "current" dereference inside. By dealing with can_do_mlock()
    mm.h can be detached from sched.h which is good. See below, why.

    This patch
    a) removes unconditional inclusion of sched.h from mm.h
    b) makes can_do_mlock() normal function in mm/mlock.c
    c) exports can_do_mlock() to not break compilation
    d) adds sched.h inclusions back to files that were getting it indirectly.
    e) adds less bloated headers to some files (asm/signal.h, jiffies.h) that were
    getting them indirectly

    Net result is:
    a) mm.h users would get less code to open, read, preprocess, parse, ... if
    they don't need sched.h
    b) sched.h stops being dependency for significant number of files:
    on x86_64 allmodconfig touching sched.h results in recompile of 4083 files,
    after patch it's only 3744 (-8.3%).

    Cross-compile tested on

    all arm defconfigs, all mips defconfigs, all powerpc defconfigs,
    alpha alpha-up
    arm
    i386 i386-up i386-defconfig i386-allnoconfig
    ia64 ia64-up
    m68k
    mips
    parisc parisc-up
    powerpc powerpc-up
    s390 s390-up
    sparc sparc-up
    sparc64 sparc64-up
    um-x86_64
    x86_64 x86_64-up x86_64-defconfig x86_64-allnoconfig

    as well as my two usual configs.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

10 May, 2007

1 commit


03 May, 2007

1 commit


15 Mar, 2007

1 commit

  • d_alloc() failure in configfs_register_subsystem() would fail to unlock
    the mutex taken above. Reorganize the exit path to ensure the unlock
    happens.

    Reported-by: Akinobu Mita
    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Joel Becker
     

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
     

12 Feb, 2007

1 commit

  • Replace appropriate pairs of "kmem_cache_alloc()" + "memset(0)" with the
    corresponding "kmem_cache_zalloc()" call.

    Signed-off-by: Robert P. J. Day
    Cc: "Luck, Tony"
    Cc: Andi Kleen
    Cc: Roland McGrath
    Cc: James Bottomley
    Cc: Greg KH
    Acked-by: Joel Becker
    Cc: Steven Whitehouse
    Cc: Jan Kara
    Cc: Michael Halcrow
    Cc: "David S. Miller"
    Cc: Stephen Smalley
    Cc: James Morris
    Cc: Chris Wright
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     

08 Feb, 2007

1 commit

  • Attributes in configfs are text files. As such, most handlers expect to be
    able to call functions like simple_strtoul() without checking the bounds
    of the buffer. Change the call to zero terminate the buffer before calling
    the client's ->store() method. This does reduce the attribute size from
    PAGE_SIZE to PAGE_SIZE-1.

    Also, change get_zeroed_page() to alloc_page(), as we are handling the
    termination.

    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Joel Becker
     

09 Dec, 2006

1 commit


08 Dec, 2006

1 commit

  • 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
     

02 Dec, 2006

2 commits


21 Oct, 2006

1 commit


05 Oct, 2006

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6: (292 commits)
    [GFS2] Fix endian bug for de_type
    [GFS2] Initialize SELinux extended attributes at inode creation time.
    [GFS2] Move logging code into log.c (mostly)
    [GFS2] Mark nlink cleared so VFS sees it happen
    [GFS2] Two redundant casts removed
    [GFS2] Remove uneeded endian conversion
    [GFS2] Remove duplicate sb reading code
    [GFS2] Mark metadata reads for blktrace
    [GFS2] Remove iflags.h, use FS_
    [GFS2] Fix code style/indent in ops_file.c
    [GFS2] streamline-generic_file_-interfaces-and-filemap gfs fix
    [GFS2] Remove readv/writev methods and use aio_read/aio_write instead (gfs bits)
    [GFS2] inode-diet: Eliminate i_blksize from the inode structure
    [GFS2] inode_diet: Replace inode.u.generic_ip with inode.i_private (gfs)
    [GFS2] Fix typo in last patch
    [GFS2] Fix direct i/o logic in filemap.c
    [GFS2] Fix bug in Makefiles for lock modules
    [GFS2] Remove (extra) fs_subsys declaration
    [GFS2/DLM] Fix trailing whitespace
    [GFS2] Tidy up meta_io code
    ...

    Linus Torvalds
     

03 Oct, 2006

1 commit


02 Oct, 2006

1 commit


01 Oct, 2006

1 commit


28 Sep, 2006

1 commit