1. 20 11月, 2009 23 次提交
  2. 18 11月, 2009 4 次提交
  3. 16 11月, 2009 1 次提交
  4. 15 11月, 2009 2 次提交
  5. 13 11月, 2009 1 次提交
    • R
      nilfs2: fix lock order reversal in chcp operation · c1ea985c
      Ryusuke Konishi 提交于
      Will fix the following lock order reversal lockdep detected:
      
      =======================================================
      [ INFO: possible circular locking dependency detected ]
      2.6.32-rc6 #7
      -------------------------------------------------------
      chcp/30157 is trying to acquire lock:
       (&nilfs->ns_mount_mutex){+.+.+.}, at: [<fed7cfcc>] nilfs_cpfile_change_cpmode+0x46/0x752 [nilfs2]
      
      but task is already holding lock:
       (&nilfs->ns_segctor_sem){++++.+}, at: [<fed7ca32>] nilfs_transaction_begin+0xba/0x110 [nilfs2]
      
      which lock already depends on the new lock.
      
      the existing dependency chain (in reverse order) is:
      
      -> #2 (&nilfs->ns_segctor_sem){++++.+}:
             [<c105799c>] __lock_acquire+0x109c/0x139d
             [<c1057d26>] lock_acquire+0x89/0xa0
             [<c14151e2>] down_read+0x31/0x45
             [<fed6d77b>] nilfs_attach_checkpoint+0x8f/0x16b [nilfs2]
             [<fed6e393>] nilfs_get_sb+0x3e7/0x653 [nilfs2]
             [<c10c0ccb>] vfs_kern_mount+0x8b/0x124
             [<c10c0db2>] do_kern_mount+0x37/0xc3
             [<c10d7517>] do_mount+0x64d/0x69d
             [<c10d75cd>] sys_mount+0x66/0x95
             [<c1002a14>] sysenter_do_call+0x12/0x32
      
      -> #1 (&type->s_umount_key#31/1){+.+.+.}:
             [<c105799c>] __lock_acquire+0x109c/0x139d
             [<c1057d26>] lock_acquire+0x89/0xa0
             [<c104c0f3>] down_write_nested+0x34/0x52
             [<c10c08fe>] sget+0x22e/0x389
             [<fed6e133>] nilfs_get_sb+0x187/0x653 [nilfs2]
             [<c10c0ccb>] vfs_kern_mount+0x8b/0x124
             [<c10c0db2>] do_kern_mount+0x37/0xc3
             [<c10d7517>] do_mount+0x64d/0x69d
             [<c10d75cd>] sys_mount+0x66/0x95
             [<c1002a14>] sysenter_do_call+0x12/0x32
      
      -> #0 (&nilfs->ns_mount_mutex){+.+.+.}:
             [<c1057727>] __lock_acquire+0xe27/0x139d
             [<c1057d26>] lock_acquire+0x89/0xa0
             [<c1414d63>] mutex_lock_nested+0x41/0x23e
             [<fed7cfcc>] nilfs_cpfile_change_cpmode+0x46/0x752 [nilfs2]
             [<fed801b2>] nilfs_ioctl+0x11a/0x7da [nilfs2]
             [<c10cca12>] vfs_ioctl+0x27/0x6e
             [<c10ccf93>] do_vfs_ioctl+0x491/0x4db
             [<c10cd022>] sys_ioctl+0x45/0x5f
             [<c1002a14>] sysenter_do_call+0x12/0x32
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      c1ea985c
  6. 12 11月, 2009 9 次提交
    • M
      __generic_block_fiemap(): fix for files bigger than 4GB · e04b5ef8
      Mike Hommey 提交于
      Because of an integer overflow on start_blk, various kind of wrong results
      would be returned by the generic_block_fiemap() handler, such as no
      extents when there is a 4GB+ hole at the beginning of the file, or wrong
      fe_logical when an extent starts after the first 4GB.
      Signed-off-by: NMike Hommey <mh@glandium.org>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Cc: Eric Sandeen <sandeen@sgi.com>
      Cc: Josef Bacik <jbacik@redhat.com>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e04b5ef8
    • A
      exec: setup_arg_pages() fails to return errors · fc63cf23
      Anton Blanchard 提交于
      In setup_arg_pages we work hard to assign a value to ret, but on exit we
      always return 0.
      
      Also remove a now duplicated exit path and branch to out_unlock instead.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Acked-by: NSerge Hallyn <serue@us.ibm.com>
      Reviewed-by: NWANG Cong <xiyou.wangcong@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fc63cf23
    • H
      fs: add missing compat_ptr handling for FS_IOC_RESVSP ioctl · 7779d7be
      Heiko Carstens 提交于
      For FS_IOC_RESVSP and FS_IOC_RESVSP64 compat_sys_ioctl() uses its
      arg argument as a pointer to userspace. However it is missing a
      a call to compat_ptr() which will do a proper pointer conversion.
      
      This was introduced with 3e63cbb1 "fs: Add new pre-allocation ioctls
      to vfs for compatibility with legacy xfs ioctls".
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Ankit Jain <me@ankitjain.org>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Acked-by: NArnd Bergmann <arndbergmann@googlemail.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Cc: <stable@kernel.org>		[2.6.31.x]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7779d7be
    • S
      pidns: fix a leak in /proc dentries and inodes with pid namespaces. · 29f12ca3
      Sukadev Bhattiprolu 提交于
      Daniel Lezcano reported a leak in 'struct pid' and 'struct pid_namespace'
      that is discussed in:
      
      	http://lkml.org/lkml/2009/10/2/159.
      
      To summarize the thread, when container-init is terminated, it sets the
      PF_EXITING flag, zaps other processes in the container and waits to reap
      them.  As a part of reaping, the container-init should flush any /proc
      dentries associated with the processes.  But because the container-init is
      itself exiting and the following PF_EXITING check, the dentries are not
      flushed, resulting in leak in /proc inodes and dentries.
      
      This fix reverts the commit 7766755a ("Fix /proc dcache deadlock
      in do_exit") which introduced the check for PF_EXITING.  At the time of
      the commit, shrink_dcache_parent() flushed dentries from other filesystems
      also and could have caused a deadlock which the commit fixed.  But as
      pointed out by Eric Biederman, after commit 0feae5c4,
      shrink_dcache_parent() no longer affects other filesystems.  So reverting
      the commit is now safe.
      
      As pointed out by Jan Kara, the leak is not as critical since the
      unclaimed space will be reclaimed under memory pressure or by:
      
      	echo 3 > /proc/sys/vm/drop_caches
      
      But since this check is no longer required, its best to remove it.
      Signed-off-by: NSukadev Bhattiprolu <sukadev@us.ibm.com>
      Reported-by: NDaniel Lezcano <dlezcano@fr.ibm.com>
      Acked-by: NEric W. Biederman <ebiederm@xmission.com>
      Acked-by: NJan Kara <jack@ucw.cz>
      Cc: Andrea Arcangeli <andrea@cpushare.com>
      Cc: Serge Hallyn <serue@us.ibm.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      29f12ca3
    • S
      fs/jbd: Export log_start_commit to fix ext3 build. · ff5e4b51
      Stefan Schmidt 提交于
      This fixes:
      ERROR: "log_start_commit" [fs/ext3/ext3.ko] undefined!
      Signed-off-by: NStefan Schmidt <stefan@datenfreihafen.org>
      ff5e4b51
    • J
      Btrfs: fix panic when trying to destroy a newly allocated · a6dbd429
      Josef Bacik 提交于
      There is a problem where iget5_locked will look for an inode, not find it, and
      then subsequently try to allocate it.  Another CPU will have raced in and
      allocated the inode instead, so when iget5_locked gets the inode spin lock again
      and does a search, it finds the new inode.  So it goes ahead and calls
      destroy_inode on the inode it just allocated.  The problem is we don't set
      BTRFS_I(inode)->root until the new inode is completely initialized.  This patch
      makes us set root to NULL when alloc'ing a new inode, so when we get to
      btrfs_destroy_inode and we see that root is NULL we can just free up the memory
      and continue on.  This fixes the panic
      
      http://www.kerneloops.org/submitresult.php?number=812690
      
      Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      a6dbd429
    • C
      Btrfs: allow more metadata chunk preallocation · 33b25808
      Chris Mason 提交于
      On an FS where all of the space has not been allocated into chunks yet,
      the enospc can return enospc just because the existing metadata chunks
      are full.
      
      We get around this by allowing more metadata chunks to be allocated up
      to a certain limit, and finding the right limit is a little fuzzy.  The
      problem is the reservations for delalloc would preallocate way too much
      of the FS as metadata.  We need to start saying no and just force some
      IO to happen.
      
      But we also need to let a reasonable amount of the FS become metadata.
      This bumps the hard limit up, later releases will have a better system.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      33b25808
    • J
      Btrfs: fallback on uncompressed io if compressed io fails · f5a84ee3
      Josef Bacik 提交于
      Currently compressed IO does not deal with not having its entire extent able to
      be allocated.  So if we have enough free space to allocate for the extent, but
      its not contiguous, it will fail spectacularly.  This patch fixes this by
      falling back on uncompressed IO which lets us spread the delalloc extent across
      multiple extents.  I tested this by making us randomly think the reservation had
      failed to make it fallback on the uncompressed io way and it seemed to work
      fine.  Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      f5a84ee3
    • J
      Btrfs: find ideal block group for caching · ccf0e725
      Josef Bacik 提交于
      This patch changes a few things.  Hopefully the comments are helpfull, but
      I'll try and be as verbose here.
      
      Problem:
      
      My fedora box was taking 1 minute and 21 seconds to boot with btrfs as root.
      Part of this problem was we pick the first block group we can find and start
      caching it, even if it may not have enough free space.  The other problem is
      we only search for cached block groups the first time around, which we won't
      find any cached block groups because this is a newly mounted fs, so we end up
      caching several block groups during bootup, which with alot of fragmentation
      takes around 30-45 seconds to complete, which bogs down the system.  So
      
      Solution:
      
      1) Don't cache block groups willy-nilly at first.  Instead try and figure out
      which block group has the most free, and therefore will take the least amount
      of time to cache.
      
      2) Don't be so picky about cached block groups.  The other problem is once
      we've filled up a cluster, if the block group isn't finished caching the next
      time we try and do the allocation we'll completely ignore the cluster and
      start searching from the beginning of the space, which makes us cache more
      block groups, which slows us down even more.  So instead of skipping block
      groups that are not finished caching when we have a hint, only skip the block
      group if it hasn't started caching yet.
      
      There is one other tweak in here.  Before if we allocated a chunk and still
      couldn't find new space, we'd end up switching the space info to force another
      chunk allocation.  This could make us end up with way too many chunks, so keep
      track of this particular case.
      
      With this patch and my previous cluster fixes my fedora box now boots in 43
      seconds, and according to the bootchart is not held up by our block group
      caching at all.
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      ccf0e725