1. 29 11月, 2010 3 次提交
    • L
      Un-inline get_pipe_info() helper function · 72083646
      Linus Torvalds 提交于
      This avoids some include-file hell, and the function isn't really
      important enough to be inlined anyway.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      72083646
    • L
      Export 'get_pipe_info()' to other users · c66fb347
      Linus Torvalds 提交于
      And in particular, use it in 'pipe_fcntl()'.
      
      The other pipe functions do not need to use the 'careful' version, since
      they are only ever called for things that are already known to be pipes.
      
      The normal read/write/ioctl functions are called through the file
      operations structures, so if a file isn't a pipe, they'd never get
      called.  But pipe_fcntl() is special, and called directly from the
      generic fcntl code, and needs to use the same careful function that the
      splice code is using.
      
      Cc: Jens Axboe <jaxboe@fusionio.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Dave Jones <davej@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c66fb347
    • L
      Rename 'pipe_info()' to 'get_pipe_info()' · 71993e62
      Linus Torvalds 提交于
      .. and change it to take the 'file' pointer instead of an inode, since
      that's what all users want anyway.
      
      The renaming is preparatory to exporting it to other users.  The old
      'pipe_info()' name was too generic and is already used elsewhere, so
      before making the function public we need to use a more specific name.
      
      Cc: Jens Axboe <jaxboe@fusionio.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Dave Jones <davej@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      71993e62
  2. 25 11月, 2010 3 次提交
  3. 24 11月, 2010 1 次提交
  4. 23 11月, 2010 10 次提交
  5. 20 11月, 2010 2 次提交
    • L
      ext4: Add EXT4_IOC_TRIM ioctl to handle batched discard · e681c047
      Lukas Czerner 提交于
      Filesystem independent ioctl was rejected as not common enough to be in
      core vfs ioctl. Since we still need to access to this functionality this
      commit adds ext4 specific ioctl EXT4_IOC_TRIM to dispatch
      ext4_trim_fs().
      
      It takes fstrim_range structure as an argument. fstrim_range is definec in
      the include/linux/fs.h and its definition is as follows.
      
      struct fstrim_range {
      	__u64 start;
      	__u64 len;
      	__u64 minlen;
      }
      
      start	- first Byte to trim
      len	- number of Bytes to trim from start
      minlen	- minimum extent length to trim, free extents shorter than this
        number of Bytes will be ignored. This will be rounded up to fs
        block size.
      
      After the FITRIM is done, the number of actually discarded Bytes is stored
      in fstrim_range.len to give the user better insight on how much storage
      space has been really released for wear-leveling.
      Signed-off-by: NLukas Czerner <lczerner@redhat.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      e681c047
    • L
      fs: Do not dispatch FITRIM through separate super_operation · 93bb41f4
      Lukas Czerner 提交于
      There was concern that FITRIM ioctl is not common enough to be included
      in core vfs ioctl, as Christoph Hellwig pointed out there's no real point
      in dispatching this out to a separate vector instead of just through
      ->ioctl.
      
      So this commit removes ioctl_fstrim() from vfs ioctl and trim_fs
      from super_operation structure.
      Signed-off-by: NLukas Czerner <lczerner@redhat.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      93bb41f4
  6. 19 11月, 2010 2 次提交
  7. 18 11月, 2010 5 次提交
  8. 17 11月, 2010 1 次提交
  9. 16 11月, 2010 5 次提交
  10. 15 11月, 2010 2 次提交
    • S
      GFS2: Fix inode deallocation race · 044b9414
      Steven Whitehouse 提交于
      This area of the code has always been a bit delicate due to the
      subtleties of lock ordering. The problem is that for "normal"
      alloc/dealloc, we always grab the inode locks first and the rgrp lock
      later.
      
      In order to ensure no races in looking up the unlinked, but still
      allocated inodes, we need to hold the rgrp lock when we do the lookup,
      which means that we can't take the inode glock.
      
      The solution is to borrow the technique already used by NFS to solve
      what is essentially the same problem (given an inode number, look up
      the inode carefully, checking that it really is in the expected
      state).
      
      We cannot do that directly from the allocation code (lock ordering
      again) so we give the job to the pre-existing delete workqueue and
      carry on with the allocation as normal.
      
      If we find there is no space, we do a journal flush (required anyway
      if space from a deallocation is to be released) which should block
      against the pending deallocations, so we should always get the space
      back.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      044b9414
    • G
      ioprio: grab rcu_read_lock in sys_ioprio_{set,get}() · d69b78ba
      Greg Thelen 提交于
      Using:
      - CONFIG_LOCKUP_DETECTOR=y
      - CONFIG_PREEMPT=y
      - CONFIG_LOCKDEP=y
      - CONFIG_PROVE_LOCKING=y
      - CONFIG_PROVE_RCU=y
      found a missing rcu lock during boot on a 512 MiB x86_64 ubuntu vm:
        ===================================================
        [ INFO: suspicious rcu_dereference_check() usage. ]
        ---------------------------------------------------
        kernel/pid.c:419 invoked rcu_dereference_check() without protection!
      
        other info that might help us debug this:
      
        rcu_scheduler_active = 1, debug_locks = 0
        1 lock held by ureadahead/1355:
         #0:  (tasklist_lock){.+.+..}, at: [<ffffffff8115bc09>] sys_ioprio_set+0x7f/0x29e
      
        stack backtrace:
        Pid: 1355, comm: ureadahead Not tainted 2.6.37-dbg-DEV #1
        Call Trace:
         [<ffffffff8109c10c>] lockdep_rcu_dereference+0xaa/0xb3
         [<ffffffff81088cbf>] find_task_by_pid_ns+0x44/0x5d
         [<ffffffff81088cfa>] find_task_by_vpid+0x22/0x24
         [<ffffffff8115bc3e>] sys_ioprio_set+0xb4/0x29e
         [<ffffffff8147cf21>] ? trace_hardirqs_off_thunk+0x3a/0x3c
         [<ffffffff8105c409>] sysenter_dispatch+0x7/0x2c
         [<ffffffff8147cee2>] ? trace_hardirqs_on_thunk+0x3a/0x3f
      
      The fix is to:
      a) grab rcu lock in sys_ioprio_{set,get}() and
      b) avoid grabbing tasklist_lock.
      Discussion in: http://marc.info/?l=linux-kernel&m=128951324702889Signed-off-by: NGreg Thelen <gthelen@google.com>
      Acked-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Reviewed-by: NOleg Nesterov <oleg@redhat.com>
      
      Modified by Jens to remove the now redundant inner rcu lock and
      unlock since they are now protected by the outer lock.
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      d69b78ba
  11. 13 11月, 2010 1 次提交
  12. 12 11月, 2010 3 次提交
  13. 11 11月, 2010 2 次提交