1. 14 12月, 2009 3 次提交
  2. 31 3月, 2009 1 次提交
  3. 28 6月, 2008 1 次提交
    • N
      Improve setting of "events_cleared" for write-intent bitmaps. · a0da84f3
      Neil Brown 提交于
      When an array is degraded, bits in the write-intent bitmap are not
      cleared, so that if the missing device is re-added, it can be synced
      by only updated those parts of the device that have changed since
      it was removed.
      
      The enable this a 'events_cleared' value is stored. It is the event
      counter for the array the last time that any bits were cleared.
      
      Sometimes - if a device disappears from an array while it is 'clean' -
      the events_cleared value gets updated incorrectly (there are subtle
      ordering issues between updateing events in the main metadata and the
      bitmap metadata) resulting in the missing device appearing to require
      a full resync when it is re-added.
      
      With this patch, we update events_cleared precisely when we are about
      to clear a bit in the bitmap.  We record events_cleared when we clear
      the bit internally, and copy that to the superblock which is written
      out before the bit on storage.  This makes it more "obviously correct".
      
      We also need to update events_cleared when the event_count is going
      backwards (as happens on a dirty->clean transition of a non-degraded
      array).
      
      Thanks to Mike Snitzer for identifying this problem and testing early
      "fixes".
      
      Cc:  "Mike Snitzer" <snitzer@gmail.com>
      Signed-off-by: NNeil Brown <neilb@suse.de>
      a0da84f3
  4. 25 5月, 2008 1 次提交
  5. 05 3月, 2008 1 次提交
  6. 07 2月, 2008 1 次提交
    • N
      md: Update md bitmap during resync. · b47490c9
      NeilBrown 提交于
      Currently an md array with a write-intent bitmap does not updated that bitmap
      to reflect successful partial resync.  Rather the entire bitmap is updated
      when the resync completes.
      
      This is because there is no guarentee that resync requests will complete in
      order, and tracking each request individually is unnecessarily burdensome.
      
      However there is value in regularly updating the bitmap, so add code to
      periodically pause while all pending sync requests complete, then update the
      bitmap.  Doing this only every few seconds (the same as the bitmap update
      time) does not notciably affect resync performance.
      
      [snitzer@gmail.com: export bitmap_cond_end_sync]
      Signed-off-by: NNeil Brown <neilb@suse.de>
      Cc: "Mike Snitzer" <snitzer@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b47490c9
  7. 17 10月, 2007 1 次提交
  8. 18 7月, 2007 1 次提交
    • N
      md: change bitmap_unplug and others to void functions · 4ad13663
      NeilBrown 提交于
      bitmap_unplug only ever returns 0, so it may as well be void.  Two callers try
      to print a message if it returns non-zero, but that message is already printed
      by bitmap_file_kick.
      
      write_page returns an error which is not consistently checked.  It always
      causes BITMAP_WRITE_ERROR to be set on an error, and that can more
      conveniently be checked.
      
      When the return of write_page is checked, an error causes bitmap_file_kick to
      be called - so move that call into write_page - and protect against recursive
      calls into bitmap_file_kick.
      
      bitmap_update_sb returns an error that is never checked.
      
      So make these 'void' and be consistent about checking the bit.
      Signed-off-by: NNeil Brown <neilb@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4ad13663
  9. 24 5月, 2007 1 次提交
  10. 10 2月, 2007 1 次提交
    • N
      [PATCH] md: avoid possible BUG_ON in md bitmap handling · da6e1a32
      Neil Brown 提交于
      md/bitmap tracks how many active write requests are pending on blocks
      associated with each bit in the bitmap, so that it knows when it can clear
      the bit (when count hits zero).
      
      The counter has 14 bits of space, so if there are ever more than 16383, we
      cannot cope.
      
      Currently the code just calles BUG_ON as "all" drivers have request queue
      limits much smaller than this.
      
      However is seems that some don't.  Apparently some multipath configurations
      can allow more than 16383 concurrent write requests.
      
      So, in this unlikely situation, instead of calling BUG_ON we now wait
      for the count to drop down a bit.  This requires a new wait_queue_head,
      some waiting code, and a wakeup call.
      
      Tested by limiting the counter to 20 instead of 16383 (writes go a lot slower
      in that case...).
      Signed-off-by: NNeil Brown <neilb@suse.de>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      da6e1a32
  11. 22 10月, 2006 1 次提交
  12. 03 10月, 2006 1 次提交
    • P
      [PATCH] md: new sysfs interface for setting bits in the write-intent-bitmap · 9b1d1dac
      Paul Clements 提交于
      Add a new sysfs interface that allows the bitmap of an array to be dirtied.
      The interface is write-only, and is used as follows:
      
      echo "1000" > /sys/block/md2/md/bitmap
      
      (dirty the bit for chunk 1000 [offset 0] in the in-memory and on-disk
      bitmaps of array md2)
      
      echo "1000-2000" > /sys/block/md1/md/bitmap
      
      (dirty the bits for chunks 1000-2000 in md1's bitmap)
      
      This is useful, for example, in cluster environments where you may need to
      combine two disjoint bitmaps into one (following a server failure, after a
      secondary server has taken over the array).  By combining the bitmaps on
      the two servers, a full resync can be avoided (This was discussed on the
      list back on March 18, 2005, "[PATCH 1/2] md bitmap bug fixes" thread).
      Signed-off-by: NNeil Brown <neilb@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      9b1d1dac
  13. 27 6月, 2006 2 次提交
    • N
      [PATCH] md/bitmap: change md/bitmap file handling to use bmap to file blocks · d785a06a
      NeilBrown 提交于
      If md is asked to store a bitmap in a file, it tries to hold onto the page
      cache pages for that file, manipulate them directly, and call a cocktail of
      operations to write the file out.  I don't believe this is a supportable
      approach.
      
      This patch changes the approach to use the same approach as swap files.  i.e.
      bmap is used to enumerate all the block address of parts of the file and we
      write directly to those blocks of the device.
      
      swapfile only uses parts of the file that provide a full pages at contiguous
      addresses.  We don't have that luxury so we have to cope with pages that are
      non-contiguous in storage.  To handle this we attach buffers to each page, and
      store the addresses in those buffers.
      
      With this approach the pagecache may contain data which is inconsistent with
      what is on disk.  To alleviate the problems this can cause, md invalidates the
      pagecache when releasing the file.  If the file is to be examined while the
      array is active (a non-critical but occasionally useful function), O_DIRECT io
      must be used.  And new version of mdadm will have support for this.
      
      This approach simplifies a lot of code:
       - we no longer need to keep a list of pages which we need to wait for,
         as the b_endio function can keep track of how many outstanding
         writes there are.  This saves a mempool.
       - -EAGAIN returns from write_page are no longer possible (not sure if
          they ever were actually).
      Signed-off-by: NNeil Brown <neilb@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      d785a06a
    • N
      [PATCH] md/bitmap: remove bitmap writeback daemon · 0b79ccf0
      NeilBrown 提交于
      md/bitmap currently has a separate thread to wait for writes to the bitmap
      file to complete (as we cannot get a callback on that action).
      
      However this isn't needed as bitmap_unplug is called from process context and
      waits for the writeback thread to do it's work.  The same result can be
      achieved by doing the waiting directly in bitmap_unplug.
      Signed-off-by: NNeil Brown <neilb@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      0b79ccf0
  14. 09 11月, 2005 1 次提交
  15. 10 9月, 2005 1 次提交
  16. 05 8月, 2005 1 次提交
  17. 16 7月, 2005 1 次提交
  18. 22 6月, 2005 3 次提交