Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37222e1c authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-linus' of git://neil.brown.name/md

* 'for-linus' of git://neil.brown.name/md: (27 commits)
  md: add 'recovery_start' per-device sysfs attribute
  md: rcu_read_lock() walk of mddev->disks in md_do_sync()
  md: integrate spares into array at earliest opportunity.
  md: move compat_ioctl handling into md.c
  md: revise Kconfig help for MD_MULTIPATH
  md: add MODULE_DESCRIPTION for all md related modules.
  raid: improve MD/raid10 handling of correctable read errors.
  md/raid10: print more useful messages on device failure.
  md/bitmap: update dirty flag when bitmap bits are explicitly set.
  md: Support write-intent bitmaps with externally managed metadata.
  md/bitmap: move setting of daemon_lastrun out of bitmap_read_sb
  md: support updating bitmap parameters via sysfs.
  md: factor out parsing of fixed-point numbers
  md: support bitmap offset appropriate for external-metadata arrays.
  md: remove needless setting of thread->timeout in raid10_quiesce
  md: change daemon_sleep to be in 'jiffies' rather than 'seconds'.
  md: move offset, daemon_sleep and chunksize out of bitmap structure
  md: collect bitmap-specific fields into one structure.
  md/raid1: add takeover support for raid5->raid1
  md: add honouring of suspend_{lo,hi} to raid1.
  ...
parents 76b8f82c 06e3c817
Loading
Loading
Loading
Loading
+68 −4
Original line number Diff line number Diff line
@@ -233,9 +233,9 @@ All md devices contain:

  resync_start
     The point at which resync should start.  If no resync is needed,
     this will be a very large number.  At array creation it will
     default to 0, though starting the array as 'clean' will
     set it much larger.
     this will be a very large number (or 'none' since 2.6.30-rc1).  At
     array creation it will default to 0, though starting the array as
     'clean' will set it much larger.

   new_dev
     This file can be written but not read.  The value written should
@@ -296,6 +296,51 @@ All md devices contain:
     active-idle
         like active, but no writes have been seen for a while (safe_mode_delay).

  bitmap/location
     This indicates where the write-intent bitmap for the array is
     stored.
     It can be one of "none", "file" or "[+-]N".
     "file" may later be extended to "file:/file/name"
     "[+-]N" means that many sectors from the start of the metadata.
       This is replicated on all devices.  For arrays with externally
       managed metadata, the offset is from the beginning of the
       device.
  bitmap/chunksize
     The size, in bytes, of the chunk which will be represented by a
     single bit.  For RAID456, it is a portion of an individual
     device. For RAID10, it is a portion of the array.  For RAID1, it
     is both (they come to the same thing).
  bitmap/time_base
     The time, in seconds, between looking for bits in the bitmap to
     be cleared. In the current implementation, a bit will be cleared
     between 2 and 3 times "time_base" after all the covered blocks
     are known to be in-sync.
  bitmap/backlog
     When write-mostly devices are active in a RAID1, write requests
     to those devices proceed in the background - the filesystem (or
     other user of the device) does not have to wait for them.
     'backlog' sets a limit on the number of concurrent background
     writes.  If there are more than this, new writes will by
     synchronous.
  bitmap/metadata
     This can be either 'internal' or 'external'.
     'internal' is the default and means the metadata for the bitmap
     is stored in the first 256 bytes of the allocated space and is
     managed by the md module.
     'external' means that bitmap metadata is managed externally to
     the kernel (i.e. by some userspace program)
  bitmap/can_clear
     This is either 'true' or 'false'.  If 'true', then bits in the
     bitmap will be cleared when the corresponding blocks are thought
     to be in-sync.  If 'false', bits will never be cleared.
     This is automatically set to 'false' if a write happens on a
     degraded array, or if the array becomes degraded during a write.
     When metadata is managed externally, it should be set to true
     once the array becomes non-degraded, and this fact has been
     recorded in the metadata.
     
     
     

As component devices are added to an md array, they appear in the 'md'
directory as new directories named
@@ -334,8 +379,9 @@ Each directory contains:
	Writing "writemostly" sets the writemostly flag.
	Writing "-writemostly" clears the writemostly flag.
	Writing "blocked" sets the "blocked" flag.
	Writing "-blocked" clear the "blocked" flag and allows writes
	Writing "-blocked" clears the "blocked" flag and allows writes
		to complete.
	Writing "in_sync" sets the in_sync flag.

	This file responds to select/poll. Any change to 'faulty'
	or 'blocked' causes an event.
@@ -372,6 +418,24 @@ Each directory contains:
        array.  If a value less than the current component_size is
        written, it will be rejected.

      recovery_start

        When the device is not 'in_sync', this records the number of
	sectors from the start of the device which are known to be
	correct.  This is normally zero, but during a recovery
	operation is will steadily increase, and if the recovery is
	interrupted, restoring this value can cause recovery to
	avoid repeating the earlier blocks.  With v1.x metadata, this
	value is saved and restored automatically.

	This can be set whenever the device is not an active member of
	the array, either before the array is activated, or before
	the 'slot' is set.

	Setting this to 'none' is equivalent to setting 'in_sync'.
	Setting to any other value also clears the 'in_sync' flag.
	


An active md device will also contain and entry for each active device
in the array.  These are named
+4 −5
Original line number Diff line number Diff line
@@ -185,11 +185,10 @@ config MD_MULTIPATH
	tristate "Multipath I/O support"
	depends on BLK_DEV_MD
	help
	  Multipath-IO is the ability of certain devices to address the same
	  physical disk over multiple 'IO paths'. The code ensures that such
	  paths can be defined and handled at runtime, and ensures that a
	  transparent failover to the backup path(s) happens if a IO errors
	  arrives on the primary path.
	  MD_MULTIPATH provides a simple multi-path personality for use
	  the MD framework.  It is not under active development.  New
	  projects should consider using DM_MULTIPATH which has more
	  features and more testing.

	  If unsure, say N.

+391 −58

File changed.

Preview size limit exceeded, changes collapsed.

+3 −16
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ typedef __u16 bitmap_counter_t;
#define BITMAP_BLOCK_SHIFT 9

/* how many blocks per chunk? (this is variable) */
#define CHUNK_BLOCK_RATIO(bitmap) ((bitmap)->chunksize >> BITMAP_BLOCK_SHIFT)
#define CHUNK_BLOCK_RATIO(bitmap) ((bitmap)->mddev->bitmap_info.chunksize >> BITMAP_BLOCK_SHIFT)
#define CHUNK_BLOCK_SHIFT(bitmap) ((bitmap)->chunkshift - BITMAP_BLOCK_SHIFT)
#define CHUNK_BLOCK_MASK(bitmap) (CHUNK_BLOCK_RATIO(bitmap) - 1)

@@ -118,16 +118,6 @@ typedef __u16 bitmap_counter_t;
			(CHUNK_BLOCK_SHIFT(bitmap) + PAGE_COUNTER_SHIFT - 1)
#define PAGEPTR_BLOCK_MASK(bitmap) (PAGEPTR_BLOCK_RATIO(bitmap) - 1)

/*
 * on-disk bitmap:
 *
 * Use one bit per "chunk" (block set). We do the disk I/O on the bitmap
 * file a page at a time. There's a superblock at the start of the file.
 */

/* map chunks (bits) to file pages - offset by the size of the superblock */
#define CHUNK_BIT_OFFSET(chunk) ((chunk) + (sizeof(bitmap_super_t) << 3))

#endif

/*
@@ -209,7 +199,6 @@ struct bitmap {
	int counter_bits; /* how many bits per block counter */

	/* bitmap chunksize -- how much data does each bit represent? */
	unsigned long chunksize;
	unsigned long chunkshift; /* chunksize = 2^chunkshift (for bitops) */
	unsigned long chunks; /* total number of data chunks for the array */

@@ -226,7 +215,6 @@ struct bitmap {
	/* bitmap spinlock */
	spinlock_t lock;

	long offset; /* offset from superblock if file is NULL */
	struct file *file; /* backing disk file */
	struct page *sb_page; /* cached copy of the bitmap file superblock */
	struct page **filemap; /* list of cache pages for the file */
@@ -238,7 +226,6 @@ struct bitmap {

	int allclean;

	unsigned long max_write_behind; /* write-behind mode */
	atomic_t behind_writes;

	/*
@@ -246,7 +233,6 @@ struct bitmap {
	 * file, cleaning up bits and flushing out pages to disk as necessary
	 */
	unsigned long daemon_lastrun; /* jiffies of last run */
	unsigned long daemon_sleep; /* how many seconds between updates? */
	unsigned long last_end_sync; /* when we lasted called end_sync to
				      * update bitmap with resync progress */

@@ -254,6 +240,7 @@ struct bitmap {
	wait_queue_head_t write_wait;
	wait_queue_head_t overflow_wait;

	struct sysfs_dirent *sysfs_can_clear;
};

/* the bitmap API */
@@ -282,7 +269,7 @@ void bitmap_close_sync(struct bitmap *bitmap);
void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector);

void bitmap_unplug(struct bitmap *bitmap);
void bitmap_daemon_work(struct bitmap *bitmap);
void bitmap_daemon_work(mddev_t *mddev);
#endif

#endif
+1 −0
Original line number Diff line number Diff line
@@ -360,6 +360,7 @@ static void raid_exit(void)
module_init(raid_init);
module_exit(raid_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Fault injection personality for MD");
MODULE_ALIAS("md-personality-10"); /* faulty */
MODULE_ALIAS("md-faulty");
MODULE_ALIAS("md-level--5");
Loading