27 Jul, 2008

19 commits

  • This adds the tracehook_tracer_task() hook to consolidate all forms of
    "Who is using ptrace on me?" logic. This is used for "TracerPid:" in
    /proc and for permission checks. We also clean up the selinux code the
    called an identical accessor.

    Signed-off-by: Roland McGrath
    Cc: Oleg Nesterov
    Reviewed-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roland McGrath
     
  • This moves all the ptrace hooks related to exec into tracehook.h inlines.

    This also lifts the calls for tracing out of the binfmt load_binary hooks
    into search_binary_handler() after it calls into the binfmt module. This
    change has no effect, since all the binfmt modules' load_binary functions
    did the call at the end on success, and now search_binary_handler() does
    it immediately after return if successful. We consolidate the repeated
    code, and binfmt modules no longer need to import ptrace_notify().

    Signed-off-by: Roland McGrath
    Cc: Oleg Nesterov
    Reviewed-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roland McGrath
     
  • Use WARN() instead of a printk+WARN_ON() pair; this way the message
    becomes part of the warning section for better reporting/collection.
    This way, the entire if() {} section can collapse into the WARN() as well.

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

    Arjan van de Ven
     
  • Use WARN() instead of a printk+WARN_ON() pair; this way the message becomes
    part of the warning section for better reporting/collection. Also, with this,
    one fo the if() sections collapses entirely into the WARN().

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

    Arjan van de Ven
     
  • Use WARN() instead of a printk+WARN_ON() pair; this way the message
    becomes part of the warning section for better reporting/collection.

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

    Arjan van de Ven
     
  • Kmem cache passed to constructor is only needed for constructors that are
    themselves multiplexeres. Nobody uses this "feature", nor does anybody uses
    passed kmem cache in non-trivial way, so pass only pointer to object.

    Non-trivial places are:
    arch/powerpc/mm/init_64.c
    arch/powerpc/mm/hugetlbpage.c

    This is flag day, yes.

    Signed-off-by: Alexey Dobriyan
    Acked-by: Pekka Enberg
    Acked-by: Christoph Lameter
    Cc: Jon Tollefson
    Cc: Nick Piggin
    Cc: Matt Mackall
    [akpm@linux-foundation.org: fix arch/powerpc/mm/hugetlbpage.c]
    [akpm@linux-foundation.org: fix mm/slab.c]
    [akpm@linux-foundation.org: fix ubifs]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • mapping->tree_lock has no read lockers. convert the lock from an rwlock
    to a spinlock.

    Signed-off-by: Nick Piggin
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Hugh Dickins
    Cc: "Paul E. McKenney"
    Reviewed-by: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     
  • Use get_user_pages_fast in splice. This reverts some mmap_sem batching
    there, however the biggest problem with mmap_sem tends to be hold times
    blocking out other threads rather than cacheline bouncing. Further: on
    architectures that implement get_user_pages_fast without locks, mmap_sem
    can be avoided completely anyway.

    Signed-off-by: Nick Piggin
    Cc: Dave Kleikamp
    Cc: Andy Whitcroft
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Andi Kleen
    Cc: Dave Kleikamp
    Cc: Badari Pulavarty
    Cc: Zach Brown
    Cc: Jens Axboe
    Reviewed-by: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     
  • Use get_user_pages_fast in the common/generic block and fs direct IO paths.

    Signed-off-by: Nick Piggin
    Cc: Dave Kleikamp
    Cc: Andy Whitcroft
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Andi Kleen
    Cc: Dave Kleikamp
    Cc: Badari Pulavarty
    Cc: Zach Brown
    Cc: Jens Axboe
    Reviewed-by: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     
  • Adds OMFS to the fs Kconfig and Makefile

    Signed-off-by: Bob Copeland
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bob Copeland
     
  • Add block allocation and block bitmap management routines for OMFS.

    Signed-off-by: Bob Copeland
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bob Copeland
     
  • Add functions for reading and manipulating the storage of file data in
    the extent-based OMFS.

    Signed-off-by: Bob Copeland
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bob Copeland
     
  • Add lookup and directory management routines for OMFS. The filesystem uses
    hashing based on the filename and stores collisions, unordered, in siblings
    of files' inode structures. To support telldir, the current position in
    the hash table is encoded in fpos.

    Signed-off-by: Bob Copeland
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bob Copeland
     
  • Add basic superblock and inode handling routines for OMFS

    Signed-off-by: Bob Copeland
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bob Copeland
     
  • Add header files containing OMFS on-disk and memory structures.

    Signed-off-by: Bob Copeland
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bob Copeland
     
  • Replace the BKL-based locking scheme used in the bfs driver by a private
    filesystem-wide mutex.

    Signed-off-by: Dmitri Vorobiev
    Cc: Tigran Aivazian
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitri Vorobiev
     
  • This patch makes the following cleanups:

    o removing an unused variable from bfs_fill_super();
    o removing unneeded blank spaces from pointer
    definitions.

    Signed-off-by: Dmitri Vorobiev
    Cc: Tigran Aivazian
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitri Vorobiev
     
  • The semaphore s_bmlock is used as a mutex. Convert it to the mutex API.

    Signed-off-by: Matthias Kaehlcke
    Cc: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthias Kaehlcke
     
  • Add cond_resched_lock(&dcache_lock) while scanning LRU lists on
    superblocks in __shrink_dcache_sb()

    Signed-off-by: Kentaro Makita
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kentaro Makita
     

26 Jul, 2008

21 commits

  • * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (34 commits)
    powerpc: Wireup new syscalls
    Move update_mmu_cache() declaration from tlbflush.h to pgtable.h
    powerpc/pseries: Remove kmalloc call in handling writes to lparcfg
    powerpc/pseries: Update arch vector to indicate support for CMO
    ibmvfc: Add support for collaborative memory overcommit
    ibmvscsi: driver enablement for CMO
    ibmveth: enable driver for CMO
    ibmveth: Automatically enable larger rx buffer pools for larger mtu
    powerpc/pseries: Verify CMO memory entitlement updates with virtual I/O
    powerpc/pseries: vio bus support for CMO
    powerpc/pseries: iommu enablement for CMO
    powerpc/pseries: Add CMO paging statistics
    powerpc/pseries: Add collaborative memory manager
    powerpc/pseries: Utilities to set firmware page state
    powerpc/pseries: Enable CMO feature during platform setup
    powerpc/pseries: Split retrieval of processor entitlement data into a helper routine
    powerpc/pseries: Add memory entitlement capabilities to /proc/ppc64/lparcfg
    powerpc/pseries: Split processor entitlement retrieval and gathering to helper routines
    powerpc/pseries: Remove extraneous error reporting for hcall failures in lparcfg
    powerpc: Fix compile error with binutils 2.15
    ...

    Fixed up conflict in arch/powerpc/platforms/52xx/Kconfig manually.

    Linus Torvalds
     
  • If fuse filesystem doesn't define it's own lock operations, then allow the
    lock manager to work with fuse.

    Adding lockd support for remote locking is also possible, but more rarely
    used, so leave it till later.

    Signed-off-by: Miklos Szeredi
    Cc: "J. Bruce Fields"
    Cc: Trond Myklebust
    Cc: Matthew Wilcox
    Cc: David Teigland
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Implement the get_parent export operation by sending a LOOKUP request with
    ".." as the name.

    Implement looking up an inode by node ID after it has been evicted from
    the cache. This is done by seding a LOOKUP request with "." as the name
    (for all file types, not just directories).

    The filesystem can set the FUSE_EXPORT_SUPPORT flag in the INIT reply, to
    indicate that it supports these special lookups.

    Thanks to John Muir for the original implementation of this feature.

    Signed-off-by: Miklos Szeredi
    Cc: "J. Bruce Fields"
    Cc: Trond Myklebust
    Cc: Matthew Wilcox
    Cc: David Teigland
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Add a new helper function which sends a LOOKUP request with the supplied
    name. This will be used by the next patch to send special LOOKUP requests
    with "." and ".." as the name.

    Signed-off-by: Miklos Szeredi
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Implement export_operations, to allow fuse filesystems to be exported to
    NFS. This feature has been in the out-of-tree fuse module, and is widely
    used and tested.

    It has not been originally merged into mainline, because doing the NFS
    export in userspace was thought to be a cleaner and more efficient way of
    doing it, than through the kernel.

    While that is true, it would also have involved a lot of duplicated effort
    at reimplementing NFS exporting (all the different versions of the
    protocol). This effort was unfortunately not undertaken by anyone, so we
    are left with doing it the easy but less efficient way.

    If this feature goes in, the out-of-tree fuse module can go away,
    which would have several advantages:

    - not having to maintain two versions
    - less confusion for users
    - no bugs due to kernel API changes

    Comment from hch:
    - Use the same fh_type values as XFS, since we use the same fh encoding.

    Signed-off-by: Miklos Szeredi
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Use d_splice_alias() instead of d_add() in fuse lookup code, to allow NFS
    exporting.

    Signed-off-by: Miklos Szeredi
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Allow filesystem's ->lock() method to call posix_lock_file() instead of
    posix_lock_file_wait(), and return FILE_LOCK_DEFERRED. This makes it
    possible to implement a such a ->lock() function, that works with the lock
    manager, which needs the call to be asynchronous.

    Now the vfs_lock_file() helper can be used, so this is a cleanup as well.

    Signed-off-by: Miklos Szeredi
    Cc: "J. Bruce Fields"
    Cc: Trond Myklebust
    Cc: Matthew Wilcox
    Cc: David Teigland
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Extract common code into a function.

    Signed-off-by: Miklos Szeredi
    Cc: "J. Bruce Fields"
    Cc: Trond Myklebust
    Cc: Matthew Wilcox
    Cc: David Teigland
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Use a special error value FILE_LOCK_DEFERRED to mean that a locking
    operation returned asynchronously. This is returned by

    posix_lock_file() for sleeping locks to mean that the lock has been
    queued on the block list, and will be woken up when it might become
    available and needs to be retried (either fl_lmops->fl_notify() is
    called or fl_wait is woken up).

    f_op->lock() to mean either the above, or that the filesystem will
    call back with fl_lmops->fl_grant() when the result of the locking
    operation is known. The filesystem can do this for sleeping as well
    as non-sleeping locks.

    This is to make sure, that return values of -EAGAIN and -EINPROGRESS by
    filesystems are not mistaken to mean an asynchronous locking.

    This also makes error handling in fs/locks.c and lockd/svclock.c slightly
    cleaner.

    Signed-off-by: Miklos Szeredi
    Cc: Trond Myklebust
    Cc: "J. Bruce Fields"
    Cc: Matthew Wilcox
    Cc: David Teigland
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Fix nlm_fopen() to return NLM_FAILED (or NLM_LCK_DENIED_NOLOCKS) instead
    of NLM_LCK_DENIED. The latter means the lock request failed because of a
    conflicting lock (i.e. a temporary error), which is wrong in this case.

    Also fix the client to return ENOLCK instead of EAGAIN if a blocking lock
    request returns with NLM_LOCK_DENIED.

    Signed-off-by: Miklos Szeredi
    Cc: Trond Myklebust
    Cc: "J. Bruce Fields"
    Cc: Matthew Wilcox
    Cc: David Teigland
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Report per-thread I/O statistics in /proc/pid/task/tid/io and aggregate
    parent I/O statistics in /proc/pid/io. This approach follows the same
    model used to account per-process and per-thread CPU times.

    As a practial application, this allows for example to quickly find the top
    I/O consumer when a process spawns many child threads that perform the
    actual I/O work, because the aggregated I/O statistics can always be found
    in /proc/pid/io.

    [ Oleg Nesterov points out that we should check that the task is still
    alive before we iterate over the threads, but also says that we can do
    that fixup on top of this later. - Linus ]

    Acked-by: Balbir Singh
    Signed-off-by: Andrea Righi
    Cc: Matt Heaton
    Cc: Shailabh Nagar
    Acked-by-with-comments: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrea Righi
     
  • Signed-off-by: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • MS_RMT_MASK will unmask changes in do_remount_sb() anyway.

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

    Alexey Dobriyan
     
  • Current two-stage scheme of removing PDE emphasizes one bug in proc:

    open
    rmmod
    remove_proc_entry
    close

    ->release won't be called because ->proc_fops were cleared. In simple
    cases it's small memory leak.

    For every ->open, ->release has to be done. List of openers is introduced
    which is traversed at remove_proc_entry() if neeeded.

    Discussions with Al long ago (sigh).

    Signed-off-by: Alexey Dobriyan
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • This patch moves the extern of struct proc_kmsg_operations to
    fs/proc/internal.h and adds an #include "internal.h" to fs/proc/kmsg.c
    so that the latter sees the former.

    Signed-off-by: Adrian Bunk
    Cc: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • convert the local Dprintk() compile time debug printk wrappers to the
    generic pr_debug() wrapper.

    Signed-off-by: Thomas Gleixner
    Cc: Matt Domsch
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Gleixner
     
  • Now that add_partition() has been aught to propagate errors, let's check them.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Abdel Benamrouche
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Abdel Benamrouche
     
  • fs/partitions/check.c:381: warning: ignoring return value of ___device_add___,
    declared with attribute warn_unused_result

    [akpm@linux-foundation.org: multiple-return-statements-per-function are evil]
    Signed-off-by: Abdel Benamrouche
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Abdel Benamrouche
     
  • ELF_CORE_EFLAGS is already used by the binfmt_elf coredumper to set correct
    arch specific ELF header flags on coredumps. Use it for kcore dumps as well.
    At the moment, this affects the CRIS and the H8300 arch.

    Signed-off-by: Edgar E. Iglesias
    Cc: Mikael Starvik
    Cc: Yoshinori Sato
    Cc: Ralf Baechle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Edgar E. Iglesias
     
  • I don't understand why the multi-thread coredump implies the core_uses_pid
    behaviour, but we shouldn't use mm->mm_users for that. This counter can
    be incremented by get_task_mm(). Use the valued returned by
    coredump_wait() instead.

    Also, remove the "const char *pattern" argument, format_corename() can use
    core_pattern directly.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Oleg Nesterov
    Cc: Roland McGrath
    Cc: Alan Cox
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Now that we have core_state->dumper list we can use it to wake up the
    sub-threads waiting for the coredump completion.

    This uglifies the code and .text grows by 47 bytes, but otoh mm_struct
    lessens by sizeof(struct completion). Also, with this change we can
    decouple exit_mm() from the coredumping code.

    Signed-off-by: Oleg Nesterov
    Cc: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov