1. 11 10月, 2011 2 次提交
  2. 07 10月, 2011 8 次提交
  3. 23 9月, 2011 1 次提交
    • D
      md: don't delay reboot by 1 second if no MD devices exist · 2dba6a91
      Daniel P. Berrange 提交于
      The md_notify_reboot() method includes a call to mdelay(1000),
      to deal with "exotic SCSI devices" which are too volatile on
      reboot. The delay is unconditional. Even if the machine does
      not have any block devices, let alone MD devices, the kernel
      shutdown sequence is slowed down.
      
      1 second does not matter much with physical hardware, but with
      certain virtualization use cases any wasted time in the bootup
      & shutdown sequence counts for alot.
      
      * drivers/md/md.c: md_notify_reboot() - only impose a delay if
        there was at least one MD device to be stopped during reboot
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      2dba6a91
  4. 21 9月, 2011 4 次提交
    • W
      7e841526
    • N
      md/bitmap: improve handling of 'allclean'. · 2585f3ef
      NeilBrown 提交于
      The 'allclean' flag is used to cache the fact that there is nothing to
      do, so we can avoid waking up and scanning the bitmap regularly.
      
      The two sorts of pages that might need the attention of the bitmap
      daemon are BITMAP_PAGE_PENDING and BITMAP_PAGE_NEEDWRITE pages.
      
      So make sure allclean reflects exactly when there are none of those.
      So:
        set it before scanning all pages with either bit set.
        clear it whenever these bits are set
        clear it when we desire not to clear one of these bits.
        don't clear it any other time.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      2585f3ef
    • N
      md/bitmap: rename and tidy up BITMAP_PAGE_CLEAN · 5a537df4
      NeilBrown 提交于
      The flag 'BITMAP_PAGE_CLEAN' has a confusing name as it doesn't mean
      that the page is clean, but rather that there are counters in the page
      which allow bits in the bitmap to be cleared - i.e. maybe cleaning can
      happen.
      
      So change it to BITMAP_PAGE_PENDING and fix some irregularities:
       - Don't set it in bitmap_init_from_disk as bitmap_set_memory_bits
         sets it when needed
       - in bitmap_daemon_work, if we find a counter that is '1', but
         need_sync is set, then set BITMAP_PAGE_PENDING again (it was
         recently cleared) to ensure we don't forget about this bit.
      
      Signed-off-by: NeilBrown <neilb@suse.de>   
      5a537df4
    • N
      md: Avoid waking up a thread after it has been freed. · 01f96c0a
      NeilBrown 提交于
      Two related problems:
      
      1/ some error paths call "md_unregister_thread(mddev->thread)"
         without subsequently clearing ->thread.  A subsequent call
         to mddev_unlock will try to wake the thread, and crash.
      
      2/ Most calls to md_wakeup_thread are protected against the thread
         disappeared either by:
            - holding the ->mutex
            - having an active request, so something else must be keeping
              the array active.
         However mddev_unlock calls md_wakeup_thread after dropping the
         mutex and without any certainty of an active request, so the
         ->thread could theoretically disappear.
         So we need a spinlock to provide some protections.
      
      So change md_unregister_thread to take a pointer to the thread
      pointer, and ensure that it always does the required locking, and
      clears the pointer properly.
      Reported-by: N"Moshe Melnikov" <moshe@zadarastorage.com>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      cc: stable@kernel.org
      01f96c0a
  5. 10 9月, 2011 3 次提交
    • N
      md: Fix handling for devices from 2TB to 4TB in 0.90 metadata. · 27a7b260
      NeilBrown 提交于
      0.90 metadata uses an unsigned 32bit number to count the number of
      kilobytes used from each device.
      This should allow up to 4TB per device.
      However we multiply this by 2 (to get sectors) before casting to a
      larger type, so sizes above 2TB get truncated.
      
      Also we allow rdev->sectors to be larger than 4TB, so it is possible
      for the array to be resized larger than the metadata can handle.
      So make sure rdev->sectors never exceeds 4TB when 0.90 metadata is in
      used.
      
      Also the sanity check at the end of super_90_load should include level
      1 as it used ->size too. (RAID0 and Linear don't use ->size at all).
      Reported-by: NPim Zandbergen <P.Zandbergen@macroscoop.nl>
      Cc: stable@kernel.org
      Signed-off-by: NNeilBrown <neilb@suse.de>
      27a7b260
    • N
      md/raid1,10: Remove use-after-free bug in make_request. · 079fa166
      NeilBrown 提交于
      A single request to RAID1 or RAID10 might result in multiple
      requests if there are known bad blocks that need to be avoided.
      
      To detect if we need to submit another write request we test:
       	if (sectors_handled < (bio->bi_size >> 9)) {
      
      However this is after we call **_write_done() so the 'bio' no longer
      belongs to us - the writes could have completed and the bio freed.
      
      So move the **_write_done call until after the test against
      bio->bi_size.
      
      This addresses https://bugzilla.kernel.org/show_bug.cgi?id=41862Reported-by: NBruno Wolff III <bruno@wolff.to>
      Tested-by: NBruno Wolff III <bruno@wolff.to>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      079fa166
    • N
      md/raid10: unify handling of write completion. · 19d5f834
      NeilBrown 提交于
      A write can complete at two different places:
      1/ when the last member-device write completes, through
         raid10_end_write_request
      2/ in make_request() when we remove the initial bias from ->remaining.
      
      These two should do exactly the same thing and the comment says they
      do, but they don't.
      
      So factor the correct code out into a function and call it in both
      places.  This makes the code much more similar to RAID1.
      
      The difference is only significant if there is an error, and they
      usually take a while, so it is unlikely that there will be an error
      already when make_request is completing, so this is unlikely to cause
      real problems.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      19d5f834
  6. 31 8月, 2011 1 次提交
    • N
      md/raid5: fix a hang on device failure. · 43220aa0
      NeilBrown 提交于
      Waiting for a 'blocked' rdev to become unblocked in the raid5d thread
      cannot work with internal metadata as it is the raid5d thread which
      will clear the blocked flag.
      This wasn't a problem in 3.0 and earlier as we only set the blocked
      flag when external metadata was used then.
      However we now set it always, so we need to be more careful.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      43220aa0
  7. 30 8月, 2011 1 次提交
  8. 25 8月, 2011 4 次提交
  9. 23 8月, 2011 4 次提交
  10. 22 8月, 2011 4 次提交
  11. 21 8月, 2011 1 次提交
  12. 20 8月, 2011 4 次提交
  13. 19 8月, 2011 3 次提交
    • D
      PCI: OF: Don't crash when bridge parent is NULL. · 69566dd8
      David Daney 提交于
      In pcibios_get_phb_of_node(), we will crash while booting if
      bus->bridge->parent is NULL.
      
      Check for this case and avoid dereferencing the NULL pointer.
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      69566dd8
    • J
      drivers/ata/sata_dwc_460ex.c: add missing kfree · a081da63
      Julia Lawall 提交于
      Currently, error handling code in this function calls the function
      sata_dwc_port_stop, but this function has essentially no effect if hsdevp
      has not been stored in ap, which is the case throughout this function.  The
      only effect is to print a debugging message including ap->print_id.
      
      The code is rewritten to not call sata_dwc_port_stop, but instead to jump
      to a local label that prints the original error message and the print_id
      information.  In the case where hsdevp has been already allocated (but not
      yet stored in ap), this value is freed as well.
      
      A simplified version of the semantic match that finds this problem is as
      follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @exists@
      local idexpression x;
      statement S,S1;
      expression E;
      identifier fl;
      expression *ptr != NULL;
      @@
      
      x = \(kmalloc\|kzalloc\|kcalloc\)(...);
      ...
      if (x == NULL) S
      <... when != x
           when != if (...) { <+...kfree(x)...+> }
           when any
           when != true x == NULL
      x->fl
      ...>
      (
      if (x == NULL) S1
      |
      if (...) { ... when != x
                     when forall
      (
       return \(0\|<+...x...+>\|ptr\);
      |
      * return ...;
      )
      }
      )
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
      a081da63
    • A
      ata: Add iMX pata support · e39c75cf
      Arnaud Patard (Rtp) 提交于
      Add basic support for pata on iMX. It has been tested only on imx51.
      SDMA support will probably be added later so this version supports only
      PIO.
      
      v2:
        - enable only when needed IORDY
        - use dev_get_drvdata
      v3:
        - add missing clk_put() calls
        - use platform_get_irq()
        - fix resume code to avoid disabling IORDY on resume
      v4:
        - Remove EXPERIMENTAL and switch to depends on ARCH_MXC
        - Use devm_kzalloc()
        - make clock a must-have
        - Use only 1 ioremap
      Signed-off-by: NArnaud Patard <arnaud.patard@rtp-net.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      e39c75cf