1. 18 May, 2011 2 commits
    • Konrad Rzeszutek Wilk's avatar
      xen/p2m: Add EXPORT_SYMBOL_GPL to the M2P override functions. · c9ce9e43
      Konrad Rzeszutek Wilk authored
      If the backends, which use these two functions, are compiled as
      a module we need these two functions to be exported.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      c9ce9e43
    • Konrad Rzeszutek Wilk's avatar
      xen/p2m/m2p/gnttab: Support GNTMAP_host_map in the M2P override. · d5431d52
      Konrad Rzeszutek Wilk authored
      We only supported the M2P (and P2M) override only for the
      GNTMAP_contains_pte type mappings. Meaning that we grants
      operations would "contain the machine address of the PTE to update"
      If the flag is unset, then the grant operation is
      "contains a host virtual address". The latter case means that
      the Hypervisor takes care of updating our page table
      (specifically the PTE entry) with the guest's MFN. As such we should
      not try to do anything with the PTE. Previous to this patch
      we would try to clear the PTE which resulted in Xen hypervisor
      being upset with us:
      
      (XEN) mm.c:1066:d0 Attempt to implicitly unmap a granted PTE c0100000ccc59067
      (XEN) domain_crash called from mm.c:1067
      (XEN) Domain 0 (vcpu#0) crashed on cpu#3:
      (XEN) ----[ Xen-4.0-110228  x86_64  debug=y  Not tainted ]----
      
      and crashing us.
      
      This patch allows us to inhibit the PTE clearing in the PV guest
      if the GNTMAP_contains_pte is not set.
      
      On the m2p_remove_override path we provide the same parameter.
      
      Sadly in the grant-table driver we do not have a mechanism to
      tell m2p_remove_override whether to clear the PTE or not. Since
      the grant-table driver is used by user-space, we can safely assume
      that it operates only on PTE's. Hence the implementation for
      it to work on !GNTMAP_contains_pte returns -EOPNOTSUPP. In the future
      we can implement the support for this. It will require some extra
      accounting structure to keep track of the page[i], and the flag.
      
      [v1: Added documentation details, made it return -EOPNOTSUPP instead
       of trying to do a half-way implementation]
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      d5431d52
  2. 12 May, 2011 3 commits
  3. 06 May, 2011 18 commits
  4. 05 May, 2011 1 commit
  5. 21 Apr, 2011 3 commits
    • Tejun Heo's avatar
      block: don't block events on excl write for non-optical devices · d4dc210f
      Tejun Heo authored
      Disk event code automatically blocks events on excl write.  This is
      primarily to avoid issuing polling commands while burning is in
      progress.  This behavior doesn't fit other types of devices with
      removeable media where polling commands don't have adverse side
      effects and door locking usually doesn't exist.
      
      This patch introduces new genhd flag which controls the auto-blocking
      behavior and uses it to enable auto-blocking only on optical devices.
      
      Note for stable: 2.6.38 and later only
      
      Cc: stable@kernel.org
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      d4dc210f
    • Tejun Heo's avatar
      block: rescan partitions on invalidated devices on -ENOMEDIA too · 1196f8b8
      Tejun Heo authored
      __blkdev_get() doesn't rescan partitions if disk->fops->open() fails,
      which leads to ghost partition devices lingering after medimum removal
      is known to both the kernel and userland.  The behavior also creates a
      subtle inconsistency where O_NONBLOCK open, which doesn't fail even if
      there's no medium, clears the ghots partitions, which is exploited to
      work around the problem from userland.
      
      Fix it by updating __blkdev_get() to issue partition rescan after
      -ENOMEDIA too.
      
      This was reported in the following bz.
      
       https://bugzilla.kernel.org/show_bug.cgi?id=13029
      
      Note for stable: 2.6.38 and later only
      
      Cc: stable@kernel.org
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarDavid Zeuthen <zeuthen@gmail.com>
      Reported-by: default avatarMartin Pitt <martin.pitt@ubuntu.com>
      Reported-by: default avatarKay Sievers <kay.sievers@vrfy.org>
      Tested-by: default avatarKay Sievers <kay.sievers@vrfy.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      1196f8b8
    • Tejun Heo's avatar
      cdrom: always check_disk_change() on open · ea6949b6
      Tejun Heo authored
      cdrom_open() called check_disk_change() after the rest of open path
      succeeded which leads to the following bizarre behavior.
      
      * After media change, if the device opened without O_NONBLOCK,
        open_for_data() naturally fails with -ENOMEDIA and
        check_disk_change() is never called.  The media is known to be gone
        and the open failure makes it obvious to the userland but device
        invalidation never happens.
      
      * But if the device is opened with O_NONBLOCK, all the checks are
        bypassed and cdrom_open() doesn't notice that the media is not there
        and check_disk_change() is called and invalidation happens.
      
      There's nothing to be gained by avoiding calling check_disk_change()
      on open failure.  Common cases end up calling check_disk_change()
      anyway.  All we get is inconsistent behavior.
      
      Fix it by moving check_disk_change() invocation to the top of
      cdrom_open() so that it always gets called regardless of how the rest
      of open proceeds.
      
      Note for stable: 2.6.38 and later only
      
      Cc: stable@kernel.org
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarAmit Shah <amit.shah@redhat.com>
      Tested-by: default avatarAmit Shah <amit.shah@redhat.com>
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      ea6949b6
  6. 19 Apr, 2011 1 commit
  7. 18 Apr, 2011 12 commits