1. 28 2月, 2013 7 次提交
  2. 26 2月, 2013 1 次提交
  3. 23 2月, 2013 1 次提交
  4. 22 2月, 2013 6 次提交
    • G
      loopdev: ignore negative offset when calculate loop device size · b7a1da69
      Guo Chao 提交于
      Negative offset may cause loop device size larger than backing file
      size.
      
       $ fallocate -l 1M a
       $ losetup --offset 0xffffffffffff0000 /dev/loop0 a
       $ blockdev --getsize64 /dev/loop0
       1114112
       $ ls -l a
       -rw-r--r-- 1 root root 1048576 Jan 23 12:46 a
       $ cat /dev/loop0
       cat: /dev/loop0: Input/output error
      
      It makes no sense to do that. Only apply offset when it's positive.
      
      Fix a typo in the comment by the way.
      Signed-off-by: NGuo Chao <yan@linux.vnet.ibm.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Guo Chao <yan@linux.vnet.ibm.com>
      Cc: M. Hindess <hindessm@uk.ibm.com>
      Cc: Nikanth Karthikesan <knikanth@suse.de>
      Cc: Jens Axboe <axboe@kernel.dk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      b7a1da69
    • G
      loopdev: remove an user triggerable oops · b1a66504
      Guo Chao 提交于
      When loopdev is built as module and we pass an invalid parameter,
      loop_init() will return directly without deregister misc device, which
      will cause an oops when insert loop module next time because we left some
      garbage in the misc device list.
      
      Test case:
      sudo modprobe loop max_part=1024
      (failed due to invalid parameter)
      sudo modprobe loop
      (oops)
      
      Clean up nicely to avoid such oops.
      Signed-off-by: NGuo Chao <yan@linux.vnet.ibm.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Guo Chao <yan@linux.vnet.ibm.com>
      Cc: M. Hindess <hindessm@uk.ibm.com>
      Cc: Nikanth Karthikesan <knikanth@suse.de>
      Cc: Jens Axboe <axboe@kernel.dk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      b1a66504
    • G
      loopdev: move common code into loop_figure_size() · 7b0576a3
      Guo Chao 提交于
      Update block device size in accord with gendisk size and let userspace
      know the change in loop_figure_size(). This is a clean up to remove
      common code of loop_figure_size()'s two callers.
      Signed-off-by: NGuo Chao <yan@linux.vnet.ibm.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Guo Chao <yan@linux.vnet.ibm.com>
      Cc: M. Hindess <hindessm@uk.ibm.com>
      Cc: Nikanth Karthikesan <knikanth@suse.de>
      Cc: Jens Axboe <axboe@kernel.dk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      7b0576a3
    • G
      loopdev: update block device size in loop_set_status() · 541c742a
      Guo Chao 提交于
      Loop device driver sometimes fails to impose the size limit on the
      device. Keep issuing following two commands:
      
      losetup --offset 7517244416 --sizelimit 3224971264 /dev/loop0 backed_file
      blockdev --getsize64 /dev/loop0
      
      blockdev reports file size instead of sizelimit several out of 100 times.
      
      The problems are:
      
      	- losetup set up the device in two ioctl:
      		  LOOP_SET_FD and LOOP_SET_STATUS64.
      
      	- LOOP_SET_STATUS64 only update size of gendisk.
      
      Block device size will be updated lazily when device comes to use. If udev
      rushes in between the two ioctl, it will bring in a block device whose
      size is backing file size. If the device is not released after
      LOOP_SET_STATUS64 ioctl, blockdev will not see the updated size.
      
      Update block size in LOOP_SET_STATUS64 ioctl.
      Signed-off-by: NGuo Chao <yan@linux.vnet.ibm.com>
      Reported-by: NM. Hindess <hindessm@uk.ibm.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Guo Chao <yan@linux.vnet.ibm.com>
      Cc: Nikanth Karthikesan <knikanth@suse.de>
      Cc: Jens Axboe <axboe@kernel.dk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      541c742a
    • G
      loopdev: fix a deadlock · 5370019d
      Guo Chao 提交于
      bd_mutex and lo_ctl_mutex can be held in different order.
      
      Path #1:
      
      blkdev_open
       blkdev_get
        __blkdev_get (hold bd_mutex)
         lo_open (hold lo_ctl_mutex)
      
      Path #2:
      
      blkdev_ioctl
       lo_ioctl (hold lo_ctl_mutex)
        lo_set_capacity (hold bd_mutex)
      
      Lockdep does not report it, because path #2 actually holds a subclass of
      lo_ctl_mutex.  This subclass seems creep into the code by mistake.  The
      patch author actually just mentioned it in the changelog, see commit
      f028f3b2 ("loop: fix circular locking in loop_clr_fd()"), also see:
      
      	http://marc.info/?l=linux-kernel&m=123806169129727&w=2
      
      Path #2 hold bd_mutex to call bd_set_size(), I've protected it
      with i_mutex in a previous patch, so drop bd_mutex at this site.
      Signed-off-by: NGuo Chao <yan@linux.vnet.ibm.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Guo Chao <yan@linux.vnet.ibm.com>
      Cc: M. Hindess <hindessm@uk.ibm.com>
      Cc: Nikanth Karthikesan <knikanth@suse.de>
      Cc: Jens Axboe <axboe@kernel.dk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      5370019d
    • C
      drivers/block/swim3.c: fix null pointer dereference · 7414d4f6
      Cong Ding 提交于
      The use of pointer fs should be after the null check.
      Signed-off-by: NCong Ding <dinggnu@gmail.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      7414d4f6
  5. 20 2月, 2013 4 次提交
    • R
      xen-blkback: use balloon pages for persistent grants · 087ffecd
      Roger Pau Monne 提交于
      With current persistent grants implementation we are not freeing the
      persistent grants after we disconnect the device. Since grant map
      operations change the mfn of the allocated page, and we can no longer
      pass it to __free_page without setting the mfn to a sane value, use
      balloon grant pages instead, as the gntdev device does.
      Signed-off-by: NRoger Pau Monné <roger.pau@citrix.com>
      Cc: stable@vger.kernel.org
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      087ffecd
    • K
      xen-blkfront: drop the use of llist_for_each_entry_safe · f84adf49
      Konrad Rzeszutek Wilk 提交于
      Replace llist_for_each_entry_safe with a while loop.
      
      llist_for_each_entry_safe can trigger a bug in GCC 4.1, so it's best
      to remove it and use a while loop and do the deletion manually.
      
      Specifically this bug can be triggered by hot-unplugging a disk, either
      by doing xm block-detach or by save/restore cycle.
      
      BUG: unable to handle kernel paging request at fffffffffffffff0
      IP: [<ffffffffa0047223>] blkif_free+0x63/0x130 [xen_blkfront]
      The crash call trace is:
      	...
      bad_area_nosemaphore+0x13/0x20
      do_page_fault+0x25e/0x4b0
      page_fault+0x25/0x30
      ? blkif_free+0x63/0x130 [xen_blkfront]
      blkfront_resume+0x46/0xa0 [xen_blkfront]
      xenbus_dev_resume+0x6c/0x140
      pm_op+0x192/0x1b0
      device_resume+0x82/0x1e0
      dpm_resume+0xc9/0x1a0
      dpm_resume_end+0x15/0x30
      do_suspend+0x117/0x1e0
      
      When drilling down to the assembler code, on newer GCC it does
      .L29:
              cmpq    $-16, %r12      #, persistent_gnt check
              je      .L30    	#, out of the loop
      .L25:
      	... code in the loop
              testq   %r13, %r13      # n
              je      .L29    	#, back to the top of the loop
              cmpq    $-16, %r12      #, persistent_gnt check
              movq    16(%r12), %r13  # <variable>.node.next, n
              jne     .L25    	#,	back to the top of the loop
      .L30:
      
      While on GCC 4.1, it is:
      L78:
      	... code in the loop
      	testq   %r13, %r13      # n
              je      .L78    #,	back to the top of the loop
              movq    16(%rbx), %r13  # <variable>.node.next, n
              jmp     .L78    #,	back to the top of the loop
      
      Which basically means that the exit loop condition instead of
      being:
      
      	&(pos)->member != NULL;
      
      is:
      	;
      
      which makes the loop unbound.
      
      Since xen-blkfront is the only user of the llist_for_each_entry_safe
      macro remove it from llist.h.
      
      Orabug: 16263164
      CC: stable@vger.kernel.org
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      f84adf49
    • K
      xen/blkback: Don't trust the handle from the frontend. · 01c681d4
      Konrad Rzeszutek Wilk 提交于
      The 'handle' is the device that the request is from. For the life-time
      of the ring we copy it from a request to a response so that the frontend
      is not surprised by it. But we do not need it - when we start processing
      I/Os we have our own 'struct phys_req' which has only most essential
      information about the request. In fact the 'vbd_translate' ends up
      over-writing the preq.dev with a value from the backend.
      
      This assignment of preq.dev with the 'handle' value is superfluous
      so lets not do it.
      
      Cc: stable@vger.kernel.org
      Acked-by: NJan Beulich <jbeulich@suse.com>
      Acked-by: NIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      01c681d4
    • J
      xen-blkback: do not leak mode property · 9d092603
      Jan Beulich 提交于
      "be->mode" is obtained from xenbus_read(), which does a kmalloc() for
      the message body. The short string is never released, so do it along
      with freeing "be" itself, and make sure the string isn't kept when
      backend_changed() doesn't complete successfully (which made it
      desirable to slightly re-structure that function, so that the error
      cleanup can be done in one place).
      Reported-by: NOlaf Hering <olaf@aepfle.de>
      CC: stable@vger.kernel.org
      Signed-off-by: NJan Beulich <jbeulich@suse.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      9d092603
  6. 19 2月, 2013 1 次提交
  7. 15 2月, 2013 1 次提交
  8. 09 2月, 2013 1 次提交
  9. 07 2月, 2013 2 次提交
    • J
      rsxx: add slab.h include to dma.c · e5e9fdaa
      Jens Axboe 提交于
      kbuild test robot says:
      
      tree:   git://git.kernel.dk/linux-block.git for-3.9/drivers
      head:   1262e24a
      commit: 8722ff8c [6/8] block: IBM RamSan 70/80 device driver
      config: make ARCH=alpha allyesconfig
      
      All error/warnings:
      
         drivers/block/rsxx/dma.c: In function 'rsxx_complete_dma':
      >> drivers/block/rsxx/dma.c:251:2: error: implicit declaration of function 'kmem_cache_free' [-Werror=implicit-function-declaration]
         drivers/block/rsxx/dma.c: In function 'rsxx_queue_discard':
      >> drivers/block/rsxx/dma.c:567:2: error: implicit declaration of function 'kmem_cache_alloc' [-Werror=implicit-function-declaration]
      >> drivers/block/rsxx/dma.c:567:6: warning: assignment makes pointer from integer without a cast [enabled by default]
         drivers/block/rsxx/dma.c: In function 'rsxx_queue_dma':
      >> drivers/block/rsxx/dma.c:601:6: warning: assignment makes pointer from integer without a cast [enabled by default]
         drivers/block/rsxx/dma.c: In function 'rsxx_dma_init':
      >> drivers/block/rsxx/dma.c:985:2: error: implicit declaration of function 'KMEM_CACHE' [-Werror=implicit-function-declaration]
      >> drivers/block/rsxx/dma.c:985:29: error: 'rsxx_dma' undeclared (first use in this function)
         drivers/block/rsxx/dma.c:985:29: note: each undeclared identifier is reported only once for each function it appears in
      >> drivers/block/rsxx/dma.c:985:39: error: 'SLAB_HWCACHE_ALIGN' undeclared (first use in this function)
         drivers/block/rsxx/dma.c: In function 'rsxx_dma_cleanup':
      >> drivers/block/rsxx/dma.c:995:2: error: implicit declaration of function 'kmem_cache_destroy' [-Werror=implicit-function-declaration]
         cc1: some warnings being treated as errors
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      e5e9fdaa
    • H
      drivers/block/mtip32xx: add missing GENERIC_HARDIRQS dependency · 1262e24a
      Heiko Carstens 提交于
      The MTIP32XX driver calls devm_request_irq() and therefore needs a
      GENERIC_HARDIRQS dependency to prevent building it on s390.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      1262e24a
  10. 06 2月, 2013 1 次提交
  11. 05 2月, 2013 1 次提交
  12. 22 1月, 2013 2 次提交
    • K
      drivers/block/paride: remove depends on CONFIG_EXPERIMENTAL · 0cb3d9c6
      Kees Cook 提交于
      The CONFIG_EXPERIMENTAL config item has not carried much meaning for a
      while now and is almost always enabled by default. As agreed during the
      Linux kernel summit, remove it from any "depends on" lines in Kconfigs.
      
      CC: Tim Waugh <tim@cyberelk.net>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0cb3d9c6
    • L
      drbd: fix potential protocol error and resulting disconnect/reconnect · 2681f7f6
      Lars Ellenberg 提交于
      When we notice a disk failure on the receiving side,
      we stop sending it new incoming writes.
      
      Depending on exact timing of various events, the same transfer log epoch
      could end up containing both replicated (before we noticed the failure)
      and local-only requests (after we noticed the failure).
      
      The sanity checks in tl_release(), called when receiving a
      P_BARRIER_ACK, check that the ack'ed transfer log epoch matches
      the expected epoch, and the number of contained writes matches
      the number of ack'ed writes.
      
      In this case, they counted both replicated and local-only writes,
      but the peer only acknowledges those it has seen.  We get a mismatch,
      resulting in a protocol error and disconnect/reconnect cycle.
      
      Messages logged are
        "BAD! BarrierAck #%u received with n_writes=%u, expected n_writes=%u!\n"
      
      A similar issue can also be triggered when starting a resync while
      having a healthy replication link, by invalidating one side, forcing a
      full sync, or attaching to a diskless node.
      
      Fix this by closing the current epoch if the state changes in a way
      that would cause the replication intent of the next write.
      
      Epochs now contain either only non-replicated,
      or only replicated writes.
      Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
      Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
      2681f7f6
  13. 12 1月, 2013 2 次提交
    • F
      drivers/block/mtip32xx/mtip32xx.c:1726:5: sparse: symbol 'mtip_send_trim' was... · 478c030e
      Fengguang Wu 提交于
      drivers/block/mtip32xx/mtip32xx.c:1726:5: sparse: symbol 'mtip_send_trim' was not declared. Should it be static?
      
      Hi Asai,
      
      FYI, there are new sparse warnings show up in
      
      tree:   git://git.kernel.dk/linux-block.git for-3.9/drivers
      head:   3d6a8743
      commit: 15283469 [2/3] mtip32xx: add trim support
      
      >> drivers/block/mtip32xx/mtip32xx.c:1726:5: sparse: symbol 'mtip_send_trim' was not declared. Should it be static?
         drivers/block/mtip32xx/mtip32xx.c:3348:17: sparse: cast to restricted __le32
         drivers/block/mtip32xx/mtip32xx.c:4125:1: sparse: symbol 'mtip_workq_sdbf0' was not declared. Should it be static?
         drivers/block/mtip32xx/mtip32xx.c:4126:1: sparse: symbol 'mtip_workq_sdbf1' was not declared. Should it be static?
         drivers/block/mtip32xx/mtip32xx.c:4127:1: sparse: symbol 'mtip_workq_sdbf2' was not declared. Should it be static?
         drivers/block/mtip32xx/mtip32xx.c:4128:1: sparse: symbol 'mtip_workq_sdbf3' was not declared. Should it be static?
         drivers/block/mtip32xx/mtip32xx.c:4129:1: sparse: symbol 'mtip_workq_sdbf4' was not declared. Should it be static?
         drivers/block/mtip32xx/mtip32xx.c:4130:1: sparse: symbol 'mtip_workq_sdbf5' was not declared. Should it be static?
         drivers/block/mtip32xx/mtip32xx.c:4131:1: sparse: symbol 'mtip_workq_sdbf6' was not declared. Should it be static?
         drivers/block/mtip32xx/mtip32xx.c:4132:1: sparse: symbol 'mtip_workq_sdbf7' was not declared. Should it be static?
         drivers/block/mtip32xx/mtip32xx.c: In function 'mtip_hw_read_flags':
         drivers/block/mtip32xx/mtip32xx.c:2804:1: warning: the frame size of 1036 bytes is larger than 1024 bytes [-Wframe-larger-than=]
         drivers/block/mtip32xx/mtip32xx.c: In function 'mtip_hw_read_registers':
         drivers/block/mtip32xx/mtip32xx.c:2781:1: warning: the frame size of 1044 bytes is larger than 1024 bytes [-Wframe-larger-than=]
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      478c030e
    • F
      drivers/block/mtip32xx/mtip32xx.c:4029:1: sparse: symbol 'mtip_workq_sdbf0'... · 25bac122
      Fengguang Wu 提交于
      drivers/block/mtip32xx/mtip32xx.c:4029:1: sparse: symbol 'mtip_workq_sdbf0' was not declared. Should it be static?
      
      Hi Asai,
      
      FYI, there are new sparse warnings show up in
      
      tree:   git://git.kernel.dk/linux-block.git for-3.9/drivers
      head:   3d6a8743
      commit: 16c906e5 [1/3] mtip32xx: Add workqueue and NUMA support
      
      drivers/block/mtip32xx/mtip32xx.c:3267:17: sparse: cast to restricted __le32
      >> drivers/block/mtip32xx/mtip32xx.c:4029:1: sparse: symbol 'mtip_workq_sdbf0' was not declared. Should it be static?
      >> drivers/block/mtip32xx/mtip32xx.c:4030:1: sparse: symbol 'mtip_workq_sdbf1' was not declared. Should it be static?
      >> drivers/block/mtip32xx/mtip32xx.c:4031:1: sparse: symbol 'mtip_workq_sdbf2' was not declared. Should it be static?
      >> drivers/block/mtip32xx/mtip32xx.c:4032:1: sparse: symbol 'mtip_workq_sdbf3' was not declared. Should it be static?
      >> drivers/block/mtip32xx/mtip32xx.c:4033:1: sparse: symbol 'mtip_workq_sdbf4' was not declared. Should it be static?
      >> drivers/block/mtip32xx/mtip32xx.c:4034:1: sparse: symbol 'mtip_workq_sdbf5' was not declared. Should it be static?
      >> drivers/block/mtip32xx/mtip32xx.c:4035:1: sparse: symbol 'mtip_workq_sdbf6' was not declared. Should it be static?
      >> drivers/block/mtip32xx/mtip32xx.c:4036:1: sparse: symbol 'mtip_workq_sdbf7' was not declared. Should it be static?
         drivers/block/mtip32xx/mtip32xx.c: In function 'mtip_hw_read_flags':
         drivers/block/mtip32xx/mtip32xx.c:2723:1: warning: the frame size of 1036 bytes is larger than 1024 bytes [-Wframe-larger-than=]
         drivers/block/mtip32xx/mtip32xx.c: In function 'mtip_hw_read_registers':
         drivers/block/mtip32xx/mtip32xx.c:2700:1: warning: the frame size of 1044 bytes is larger than 1024 bytes [-Wframe-larger-than=]
      
      Please consider folding the below diff :-)
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      25bac122
  14. 11 1月, 2013 5 次提交
  15. 05 1月, 2013 1 次提交
    • P
      block: delete super ancient PC-XT driver for 1980's hardware · d1a6f4f1
      Paul Gortmaker 提交于
      This driver was for the 8 bit ISA cards that were installed in
      the PC-XT machines of 1980 vintage.  They supported the dual
      ribbon cable MFM drives of 10-20MB capacity, and ran at a 3:1
      interleave, giving performance on the order of 128kB/s.
      
      By the introduction of the PC-AT (286) these controllers were
      already scrapped in favour of 16 bit controllers with some onboard
      RAM that could support a 1:1 interleave.
      
      The git history doesn't show any evidence of runtime fixes that
      would reflect active usage; instead just the usual tree-wide API
      type changes/cleanups.  Going back to in-source changelogs, the
      last "runtime" fix that is evident is something I did over a
      dozen years ago[1] -- and even back then, the hardware was long
      since unavailable, so that ancient fix was also not runtime tested.
      
      The time is long overdue for this to get flushed, so lets get
      rid of it before anyone wastes more time doing builds and sparse
      checks etc. on long since dead code.
      
      [1] http://lkml.indiana.edu/hypermail/linux/kernel/0102.2/0027.htmlSigned-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      d1a6f4f1
  16. 04 1月, 2013 1 次提交
    • G
      Drivers: block: remove __dev* attributes. · 8d85fce7
      Greg Kroah-Hartman 提交于
      CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
      markings need to be removed.
      
      This change removes the use of __devinit, __devexit_p, __devinitdata,
      __devinitconst, and __devexit from these drivers.
      
      Based on patches originally written by Bill Pemberton, but redone by me
      in order to handle some of the coding style issues better, by hand.
      
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Cc: Mike Miller <mike.miller@hp.com>
      Cc: Chirag Kantharia <chirag.kantharia@hp.com>
      Cc: Geoff Levand <geoff@infradead.org>
      Cc: Jim Paris <jim@jtan.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
      Cc: Keith Busch <keith.busch@intel.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: NeilBrown <neilb@suse.de>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Tao Guo <Tao.Guo@emc.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8d85fce7
  17. 02 1月, 2013 1 次提交
    • A
      virtio-blk: Don't free ida when disk is in use · f4953fe6
      Alexander Graf 提交于
      When a file system is mounted on a virtio-blk disk, we then remove it
      and then reattach it, the reattached disk gets the same disk name and
      ids as the hot removed one.
      
      This leads to very nasty effects - mostly rendering the newly attached
      device completely unusable.
      
      Trying what happens when I do the same thing with a USB device, I saw
      that the sd node simply doesn't get free'd when a device gets forcefully
      removed.
      
      Imitate the same behavior for vd devices. This way broken vd devices
      simply are never free'd and newly attached ones keep working just fine.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: stable@kernel.org
      f4953fe6
  18. 21 12月, 2012 1 次提交
  19. 18 12月, 2012 1 次提交
    • R
      xen-blkfront: handle bvecs with partial data · d62f6918
      Roger Pau Monne 提交于
      Currently blkfront fails to handle cases in blkif_completion like the
      following:
      
      1st loop in rq_for_each_segment
       * bv_offset: 3584
       * bv_len: 512
       * offset += bv_len
       * i: 0
      
      2nd loop:
       * bv_offset: 0
       * bv_len: 512
       * i: 0
      
      In the second loop i should be 1, since we assume we only wanted to
      read a part of the previous page. This patches fixes this cases where
      only a part of the shared page is read, and blkif_completion assumes
      that if the bv_offset of a bvec is less than the previous bv_offset
      plus the bv_size we have to switch to the next shared page.
      Reported-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NRoger Pau Monné <roger.pau@citrix.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      d62f6918