1. 09 3月, 2011 8 次提交
  2. 08 3月, 2011 10 次提交
  3. 03 3月, 2011 1 次提交
  4. 02 3月, 2011 1 次提交
  5. 24 2月, 2011 1 次提交
    • M
      mm: prevent concurrent unmap_mapping_range() on the same inode · 2aa15890
      Miklos Szeredi 提交于
      Michael Leun reported that running parallel opens on a fuse filesystem
      can trigger a "kernel BUG at mm/truncate.c:475"
      
      Gurudas Pai reported the same bug on NFS.
      
      The reason is, unmap_mapping_range() is not prepared for more than
      one concurrent invocation per inode.  For example:
      
        thread1: going through a big range, stops in the middle of a vma and
           stores the restart address in vm_truncate_count.
      
        thread2: comes in with a small (e.g. single page) unmap request on
           the same vma, somewhere before restart_address, finds that the
           vma was already unmapped up to the restart address and happily
           returns without doing anything.
      
      Another scenario would be two big unmap requests, both having to
      restart the unmapping and each one setting vm_truncate_count to its
      own value.  This could go on forever without any of them being able to
      finish.
      
      Truncate and hole punching already serialize with i_mutex.  Other
      callers of unmap_mapping_range() do not, and it's difficult to get
      i_mutex protection for all callers.  In particular ->d_revalidate(),
      which calls invalidate_inode_pages2_range() in fuse, may be called
      with or without i_mutex.
      
      This patch adds a new mutex to 'struct address_space' to prevent
      running multiple concurrent unmap_mapping_range() on the same mapping.
      
      [ We'll hopefully get rid of all this with the upcoming mm
        preemptibility series by Peter Zijlstra, the "mm: Remove i_mmap_mutex
        lockbreak" patch in particular.  But that is for 2.6.39 ]
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      Reported-by: NMichael Leun <lkml20101129@newton.leun.net>
      Reported-by: NGurudas Pai <gurudas.pai@oracle.com>
      Tested-by: NGurudas Pai <gurudas.pai@oracle.com>
      Acked-by: NHugh Dickins <hughd@google.com>
      Cc: stable@kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2aa15890
  6. 22 1月, 2011 1 次提交
    • R
      nilfs2: fix crash after one superblock became unavailable · 0ca7a5b9
      Ryusuke Konishi 提交于
      Fixes the following kernel oops in nilfs_setup_super() which could
      arise if one of two super-blocks is unavailable.
      
      > BUG: unable to handle kernel NULL pointer dereference at   (null)
      > Pid: 3529, comm: mount.nilfs2 Not tainted 2.6.37 #1 /
      > EIP: 0060:[<c03196bc>] EFLAGS: 00010202 CPU: 3
      > EIP is at memcpy+0xc/0x1b
      > Call Trace:
      >  [<f953720e>] ? nilfs_setup_super+0x6c/0xa5 [nilfs2]
      >  [<f95369e9>] ? nilfs_get_root_dentry+0x81/0xcb [nilfs2]
      >  [<f9537a08>] ? nilfs_mount+0x4f9/0x62c [nilfs2]
      >  [<c02745cf>] ? kstrdup+0x36/0x3f
      >  [<f953750f>] ? nilfs_mount+0x0/0x62c [nilfs2]
      >  [<c0293940>] ? vfs_kern_mount+0x4d/0x12c
      >  [<c02a5100>] ? get_fs_type+0x76/0x8f
      >  [<c0293a68>] ? do_kern_mount+0x33/0xbf
      >  [<c02a784a>] ? do_mount+0x2ed/0x714
      >  [<c02a6171>] ? copy_mount_options+0x28/0xfc
      >  [<c02a7ce3>] ? sys_mount+0x72/0xaf
      >  [<c0473085>] ? syscall_call+0x7/0xb
      Reported-by: NWakko Warner <wakko@animx.eu.org>
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Tested-by: NWakko Warner <wakko@animx.eu.org>
      Cc: stable <stable@kernel.org> [2.6.37, 2.6.36]
      LKML-Reference: <20110121024918.GA29598@animx.eu.org>
      0ca7a5b9
  7. 11 1月, 2011 1 次提交
  8. 10 1月, 2011 10 次提交
  9. 07 1月, 2011 3 次提交
    • N
      fs: provide rcu-walk aware permission i_ops · b74c79e9
      Nick Piggin 提交于
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      b74c79e9
    • N
      fs: icache RCU free inodes · fa0d7e3d
      Nick Piggin 提交于
      RCU free the struct inode. This will allow:
      
      - Subsequent store-free path walking patch. The inode must be consulted for
        permissions when walking, so an RCU inode reference is a must.
      - sb_inode_list_lock to be moved inside i_lock because sb list walkers who want
        to take i_lock no longer need to take sb_inode_list_lock to walk the list in
        the first place. This will simplify and optimize locking.
      - Could remove some nested trylock loops in dcache code
      - Could potentially simplify things a bit in VM land. Do not need to take the
        page lock to follow page->mapping.
      
      The downsides of this is the performance cost of using RCU. In a simple
      creat/unlink microbenchmark, performance drops by about 10% due to inability to
      reuse cache-hot slab objects. As iterations increase and RCU freeing starts
      kicking over, this increases to about 20%.
      
      In cases where inode lifetimes are longer (ie. many inodes may be allocated
      during the average life span of a single inode), a lot of this cache reuse is
      not applicable, so the regression caused by this patch is smaller.
      
      The cache-hot regression could largely be avoided by using SLAB_DESTROY_BY_RCU,
      however this adds some complexity to list walking and store-free path walking,
      so I prefer to implement this at a later date, if it is shown to be a win in
      real situations. I haven't found a regression in any non-micro benchmark so I
      doubt it will be a problem.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      fa0d7e3d
    • N
      fs: dcache scale dentry refcount · b7ab39f6
      Nick Piggin 提交于
      Make d_count non-atomic and protect it with d_lock. This allows us to ensure a
      0 refcount dentry remains 0 without dcache_lock. It is also fairly natural when
      we start protecting many other dentry members with d_lock.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      b7ab39f6
  10. 16 12月, 2010 1 次提交
    • R
      nilfs2: fix regression of garbage collection ioctl · 947b10ae
      Ryusuke Konishi 提交于
      On 2.6.37-rc1, garbage collection ioctl of nilfs was broken due to the
      commit 263d90ce ("nilfs2: remove own inode hash used for GC"),
      and leading to filesystem corruption.
      
      The patch doesn't queue gc-inodes for log writer if they are reused
      through the vfs inode cache.  Here, gc-inode is the inode which
      buffers blocks to be relocated on GC.  That patch queues gc-inodes in
      nilfs_init_gcinode() function, but this function is not called when
      they don't have I_NEW flag.  Thus, some of live blocks are wrongly
      overrode without being moved to new logs.
      
      This resolves the problem by moving the gc-inode queueing to an outer
      function to ensure it's done right.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      947b10ae
  11. 24 11月, 2010 1 次提交
  12. 23 11月, 2010 1 次提交
  13. 13 11月, 2010 1 次提交
    • T
      block: clean up blkdev_get() wrappers and their users · d4d77629
      Tejun Heo 提交于
      After recent blkdev_get() modifications, open_by_devnum() and
      open_bdev_exclusive() are simple wrappers around blkdev_get().
      Replace them with blkdev_get_by_dev() and blkdev_get_by_path().
      
      blkdev_get_by_dev() is identical to open_by_devnum().
      blkdev_get_by_path() is slightly different in that it doesn't
      automatically add %FMODE_EXCL to @mode.
      
      All users are converted.  Most conversions are mechanical and don't
      introduce any behavior difference.  There are several exceptions.
      
      * btrfs now sets FMODE_EXCL in btrfs_device->mode, so there's no
        reason to OR it explicitly on blkdev_put().
      
      * gfs2, nilfs2 and the generic mount_bdev() now set FMODE_EXCL in
        sb->s_mode.
      
      * With the above changes, sb->s_mode now always should contain
        FMODE_EXCL.  WARN_ON_ONCE() added to kill_block_super() to detect
        errors.
      
      The new blkdev_get_*() functions are with proper docbook comments.
      While at it, add function description to blkdev_get() too.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Philipp Reisner <philipp.reisner@linbit.com>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Mike Snitzer <snitzer@redhat.com>
      Cc: Joern Engel <joern@lazybastard.org>
      Cc: Chris Mason <chris.mason@oracle.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp>
      Cc: reiserfs-devel@vger.kernel.org
      Cc: xfs-masters@oss.sgi.com
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      d4d77629