1. 16 8月, 2012 1 次提交
  2. 24 7月, 2012 10 次提交
  3. 18 7月, 2012 2 次提交
  4. 15 7月, 2012 1 次提交
  5. 04 7月, 2012 1 次提交
    • L
      floppy: cancel any pending fd_timeouts before adding a new one · dab058fd
      Linus Torvalds 提交于
      In commit 070ad7e7 ("floppy: convert to delayed work and
      single-thread wq") the 'fd_timeout' timer was converted to a delayed
      work.  However, the "del_timer(&fd_timeout)" was lost in the process,
      and any previous pending timeouts would stay active when we then
      re-queued the timeout.
      
      This resulted in the floppy probe sequence having a (stale) 20s timeout
      rather than the intended 3s timeout, and thus made booting with the
      floppy driver (but no actual floppy controller) take much longer than it
      should.
      
      Of course, there's little reason for most people to compile the floppy
      driver into the kernel at all, which is why most people never noticed.
      
      Canceling the delayed work where we used to do the del_timer() fixes the
      issue, and makes the floppy probing use the proper new timeout instead.
      The three second timeout is still very wasteful, but better than the 20s
      one.
      Reported-and-tested-by: NAndi Kleen <ak@linux.intel.com>
      Reported-and-tested-by: NCalvin Walton <calvin.walton@kepstin.ca>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      dab058fd
  6. 14 6月, 2012 1 次提交
    • T
      umem: fix up unplugging · 32587371
      Tao Guo 提交于
      Fix a regression introduced by 7eaceacc ("block: remove per-queue
      plugging").  In that patch, Jens removed the whole mm_unplug_device()
      function, which used to be the trigger to make umem start to work.
      
      We need to implement unplugging to make umem start to work, or I/O will
      never be triggered.
      Signed-off-by: NTao Guo <Tao.Guo@emc.com>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Shaohua Li <shli@kernel.org>
      Cc: <stable@vger.kernel.org>
      Acked-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      32587371
  7. 12 6月, 2012 4 次提交
    • L
      drbd: fix null pointer dereference with on-congestion policy when diskless · 0d5934e3
      Lars Ellenberg 提交于
      We must not look at mdev->actlog, unless we have a get_ldev() reference.
      It also does not make much sense to try to disconnect or pull-ahead of
      the peer, if we don't have good local data.
      
      Only even consider congestion policies, if our local disk is D_UP_TO_DATE.
      Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
      Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
      0d5934e3
    • L
      drbd: fix list corruption by failing but already aborted reads · 1ed25b26
      Lars Ellenberg 提交于
      If a read is aborted due to force-detach of a supposedly unresponsive
      local backing device, and retried on the peer, it can happen that the
      local request later still completes (hopefully with an error).
      As it may already have been completed to upper layers meanwhile,
      it must not be retried again now.
      Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
      Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
      1ed25b26
    • L
      drbd: fix access of unallocated pages and kernel panic · 4eccc579
      Lars Ellenberg 提交于
      BUG: unable to handle kernel NULL pointer dereference at (null)
      ...
       [<d1e17561>] ? _drbd_bm_set_bits+0x151/0x240 [drbd]
       [<d1e236f8>] ? receive_bitmap+0x4f8/0xbc0 [drbd]
      
      This fixes an off-by-one error in the receive_bitmap() path,
      if run-length encoded bitmap transfer is enabled.
      
      If the bitmap is an exact multiple of PAGE_SIZE, which means the visible
      capacity of the drbd device is an exact multiple of 128 MiB (for 4k page
      size), and bitmap compression (use-rle) is enabled (which became default
      with 8.4), and the very last bit is dirty and reported in an rle
      comressed bitmap packet, we ended up trying to kmap_atomic a page pointer
      that does not exist (bitmap->bm_pages[last index + 1]).
      
      bug introduced by:
          Date:   Fri Jul 24 15:33:24 2009 +0200
          set bits: optimize for complete last word, fix off-by-one-word corner case
      
      made effective by:
          Date:   Thu Dec 16 00:32:38 2010 +0100
          drbd: get rid of unused debug code
      
          Long time ago, we had paranoia code in the bitmap that allocated one
          extra word, assigned a magic value, and checked on every occasion that
          the magic value was still unchanged.
      
          That debug code is unused, the extra long word complicates code a bit.
          Get rid of it.
      
      No-one triggered this bug in the last few years, because a large subset
      of our userbase is unaffected:
       * typically the last few blocks of a device are not modified
         frequently, and remain unset
       * use-rle was disabled by default in drbd < 8.4
       * those with slightly "odd" device sizes, or
       * drbd internal meta data (which will skew the device size slightly,
         thus makes it harder to have a bug relevant device size)
      Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
      Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
      4eccc579
    • K
      xen/blkfront: Add WARN to deal with misbehaving backends. · 6878c32e
      Konrad Rzeszutek Wilk 提交于
      Part of the ring structure is the 'id' field which is under
      control of the frontend. The frontend stamps it with "some"
      value (this some in this implementation being a value less
      than BLK_RING_SIZE), and when it gets a response expects
      said value to be in the response structure. We have a check
      for the id field when spolling new requests but not when
      de-spolling responses.
      
      We also add an extra check in add_id_to_freelist to make
      sure that the 'struct request' was not NULL - as we cannot
      pass a NULL to __blk_end_request_all, otherwise that crashes
      (and all the operations that the response is dealing with
      end up with __blk_end_request_all).
      
      Lastly we also print the name of the operation that failed.
      
      [v1: s/BUG/WARN/ suggested by Stefano]
      [v2: Add extra check in add_id_to_freelist]
      [v3: Redid op_name per Jan's suggestion]
      [v4: add const * and add WARN on failure returns]
      Acked-by: NJan Beulich <jbeulich@suse.com>
      Acked-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      6878c32e
  8. 05 6月, 2012 2 次提交
  9. 04 6月, 2012 1 次提交
  10. 31 5月, 2012 11 次提交
  11. 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
  12. 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
  13. 15 5月, 2012 2 次提交