1. 05 6月, 2012 2 次提交
  2. 04 6月, 2012 1 次提交
  3. 31 5月, 2012 10 次提交
  4. 22 5月, 2012 2 次提交
    • A
      virtio_blk: Drop unused request tracking list · f65ca1dc
      Asias He 提交于
      Benchmark shows small performance improvement on fusion io device.
      
      Before:
        seq-read : io=1,024MB, bw=19,982KB/s, iops=39,964, runt= 52475msec
        seq-write: io=1,024MB, bw=20,321KB/s, iops=40,641, runt= 51601msec
        rnd-read : io=1,024MB, bw=15,404KB/s, iops=30,808, runt= 68070msec
        rnd-write: io=1,024MB, bw=14,776KB/s, iops=29,552, runt= 70963msec
      
      After:
        seq-read : io=1,024MB, bw=20,343KB/s, iops=40,685, runt= 51546msec
        seq-write: io=1,024MB, bw=20,803KB/s, iops=41,606, runt= 50404msec
        rnd-read : io=1,024MB, bw=16,221KB/s, iops=32,442, runt= 64642msec
        rnd-write: io=1,024MB, bw=15,199KB/s, iops=30,397, runt= 68991msec
      Signed-off-by: NAsias He <asias@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      f65ca1dc
    • A
      virtio-blk: Fix hot-unplug race in remove method · b79d866c
      Asias He 提交于
      If we reset the virtio-blk device before the requests already dispatched
      to the virtio-blk driver from the block layer are finised, we will stuck
      in blk_cleanup_queue() and the remove will fail.
      
      blk_cleanup_queue() calls blk_drain_queue() to drain all requests queued
      before DEAD marking. However it will never success if the device is
      already stopped. We'll have q->in_flight[] > 0, so the drain will not
      finish.
      
      How to reproduce the race:
      1. hot-plug a virtio-blk device
      2. keep reading/writing the device in guest
      3. hot-unplug while the device is busy serving I/O
      
      Test:
      ~1000 rounds of hot-plug/hot-unplug test passed with this patch.
      
      Changes in v3:
      - Drop blk_abort_queue and blk_abort_request
      - Use __blk_end_request_all to complete request dispatched to driver
      
      Changes in v2:
      - Drop req_in_flight
      - Use virtqueue_detach_unused_buf to get request dispatched to driver
      Signed-off-by: NAsias He <asias@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      b79d866c
  5. 18 5月, 2012 2 次提交
    • J
      floppy: remove floppy-specific O_EXCL handling · bfa10b8c
      Jiri Kosina 提交于
      Block layer now handles O_EXCL in a generic way for block devices.
      
      The semantics is however different for floppy and all other block devices,
      as floppy driver contains its own O_EXCL handling.
      
      The semantics for all-but-floppy bdevs is "there can be at most one O_EXCL
      open of this file", while for floppy bdev the semantics is "if someone has
      the bdev open with O_EXCL, noone else can open it".
      
      There is actual userspace-observable change in behavior because of this
      since commit e525fd89 ("block: make blkdev_get/put() handle exclusive
      access") -- on kernels containing this commit, mount of /dev/fd0 causes
      the fd0 block device be claimed with _EXCL, preventing subsequent
      open(/dev/fd0).
      
      Bring things back into shape, i.e.  make it possible, analogically to
      other block devices, to mount the floppy and open() it afterwards --
      remove the floppy-specific handling and let the generic bdev code O_EXCL
      handling take over.
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      Acked-by: NTejun Heo <tj@kernel.org>
      Acked-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      bfa10b8c
    • J
      floppy: convert to delayed work and single-thread wq · 070ad7e7
      Jiri Kosina 提交于
      There are several races in floppy driver between bottom half
      (scheduled_work) and timers (fd_timeout, fd_timer). Due to slowness
      of the actual floppy devices, those races are never (at least to my
      knowledge) triggered on a bare floppy metal. However on virtualized
      (emulated) floppy drives, which are of course magnitudes faster
      than the real ones, these races trigger reliably. They usually exhibit
      themselves as NULL pointer dereferences during DMA setup, such as
      
      	BUG: unable to handle kernel NULL pointer dereference at 0000000a
      	[ ... snip ... ]
      	EIP: 0060:[<c02053d5>] EFLAGS: 00010293 CPU: 0
      	EAX: ffffe000 EBX: 0000000a ECX: 00000000 EDX: 0000000a
      	ESI: c05d2718 EDI: 00000000 EBP: 00000000 ESP: f540fe44
      	 DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
      	Process swapper (pid: 0, ti=f540e000 task=c082d5a0 task.ti=c0826000)
      	Stack:
      	 ffffe000 00001ffc 00000000 00000000 00000000 c05d2718 c0708b40 f540fe80
      	 c020470f c05d2718 c0708b40 00000000 f540fe80 0000000a f540fee4 00000000
      	 c0708b40 f540fee4 00000000 00000000 c020526b 00000000 c05d2718 c0708b40
      	Call Trace:
      	 [<c020470f>] dump_trace+0xaf/0x110
      	 [<c020526b>] show_trace_log_lvl+0x4b/0x60
      	 [<c0205298>] show_trace+0x18/0x20
      	 [<c05c5811>] dump_stack+0x6d/0x72
      	 [<c0248527>] warn_slowpath_common+0x77/0xb0
      	 [<c02485f3>] warn_slowpath_fmt+0x33/0x40
      	 [<f7ec593c>] setup_DMA+0x14c/0x210 [floppy]
      	 [<f7ecaa95>] setup_rw_floppy+0x105/0x190 [floppy]
      	 [<c0256d08>] run_timer_softirq+0x168/0x2a0
      	 [<c024e762>] __do_softirq+0xc2/0x1c0
      	 [<c02042ed>] do_softirq+0x7d/0xb0
      	 [<f54d8a00>] 0xf54d89ff
      
      but other instances can be easily seen as well. This can be observed at least under
      VMWare, VirtualBox and KVM.
      
      This patch converts all the timers and bottom halfs to be processed in a single
      workqueue. This aproach has been already discussed back in 2010 if I remember
      correctly, and Acked by Linus [1], but it then never made it to the tree.
      
      This all is based on original idea and code of Stephen Hemminger.  I have
      ported original Stepen's code to the current state of the floppy driver, and
      performed quite some testing (on real hardware), which didn't reveal any issues
      (this includes not only writing and reading data, but also formatting
      (unfortunately I didn't find any Double-Density disks any more)). Ability to
      handle errors properly (supplying known bad floppies) has also been verified.
      
      [1] http://kerneltrap.org/mailarchive/linux-kernel/2010/6/11/4582092Based-on-patch-by: NStephen Hemminger <shemminger@vyatta.com>
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      070ad7e7
  6. 15 5月, 2012 7 次提交
  7. 12 5月, 2012 2 次提交
  8. 11 5月, 2012 3 次提交
    • A
      mtip32xx: release the semaphore on an error path · a09ba13e
      Asai Thambi S P 提交于
      Release the semaphore in an error path in mtip_hw_get_scatterlist(). This
      fixes the smatch warning inconsistent returns.
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NAsai Thambi S P <asamymuthupa@micron.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      a09ba13e
    • J
      dac960: Remove unused variables from DAC960_CreateProcEntries() · d88a440e
      Jesper Juhl 提交于
      The variables 'StatusProcEntry' and 'UserCommandProcEntry' are
      assigned to once and then never used. This patch gets rid of the
      variables.
      
      While I was there I also fixed the indentation of the function to use
      tabs rather than spaces for the lines that did not already do so.
      Signed-off-by: NJesper Juhl <jj@chaosbits.net>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      d88a440e
    • E
      connector/userns: replace netlink uses of cap_raised() with capable() · 38bf1953
      Eric W. Biederman 提交于
      In 2009 Philip Reiser notied that a few users of netlink connector
      interface needed a capability check and added the idiom
      cap_raised(nsp->eff_cap, CAP_SYS_ADMIN) to a few of them, on the premise
      that netlink was asynchronous.
      
      In 2011 Patrick McHardy noticed we were being silly because netlink is
      synchronous and removed eff_cap from the netlink_skb_params and changed
      the idiom to cap_raised(current_cap(), CAP_SYS_ADMIN).
      
      Looking at those spots with a fresh eye we should be calling
      capable(CAP_SYS_ADMIN).  The only reason I can see for not calling capable
      is that it once appeared we were not in the same task as the caller which
      would have made calling capable() impossible.
      
      In the initial user_namespace the only difference between between
      cap_raised(current_cap(), CAP_SYS_ADMIN) and capable(CAP_SYS_ADMIN) are a
      few sanity checks and the fact that capable(CAP_SYS_ADMIN) sets
      PF_SUPERPRIV if we use the capability.
      
      Since we are going to be using root privilege setting PF_SUPERPRIV seems
      the right thing to do.
      
      The motivation for this that patch is that in a child user namespace
      cap_raised(current_cap(),...) tests your capabilities with respect to that
      child user namespace not capabilities in the initial user namespace and
      thus will allow processes that should be unprivielged to use the kernel
      services that are only protected with cap_raised(current_cap(),..).
      
      To fix possible user_namespace issues and to just clean up the code
      replace cap_raised(current_cap(), CAP_SYS_ADMIN) with
      capable(CAP_SYS_ADMIN).
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Philipp Reisner <philipp.reisner@linbit.com>
      Acked-by: NSerge E. Hallyn <serge.hallyn@canonical.com>
      Acked-by: NAndrew G. Morgan <morgan@kernel.org>
      Cc: Vasiliy Kulikov <segoon@openwall.com>
      Cc: David Howells <dhowells@redhat.com>
      Reviewed-by: NJames Morris <james.l.morris@oracle.com>
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      38bf1953
  9. 10 5月, 2012 2 次提交
  10. 09 5月, 2012 9 次提交