1. 02 8月, 2011 5 次提交
    • J
      dm raid: support metadata devices · b12d437b
      Jonathan Brassow 提交于
      Add the ability to parse and use metadata devices to dm-raid.  Although
      not strictly required, without the metadata devices, many features of
      RAID are unavailable.  They are used to store a superblock and bitmap.
      
      The role, or position in the array, of each device must be recorded in
      its superblock.  This is to help with fault handling, array reshaping,
      and sanity checks.  RAID 4/5/6 devices must be loaded in a specific order:
      in this way, the 'array_position' field helps validate the correctness
      of the mapping when it is loaded.  It can be used during reshaping to
      identify which devices are added/removed.  Fault handling is impossible
      without this field.  For example, when a device fails it is recorded in
      the superblock.  If this is a RAID1 device and the offending device is
      removed from the array, there must be a way during subsequent array
      assembly to determine that the failed device was the one removed.  This
      is done by correlating the 'array_position' field and the bit-field
      variable 'failed_devices'.
      Signed-off-by: NJonathan Brassow <jbrassow@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      b12d437b
    • J
      dm raid: add write_mostly parameter · 46bed2b5
      Jonathan Brassow 提交于
      Add the write_mostly parameter to RAID1 dm-raid tables.
      
      This allows the user to set the WriteMostly flag on a RAID1 device that
      should normally be avoided for read I/O.
      Signed-off-by: NJonathan Brassow <jbrassow@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      46bed2b5
    • J
      dm raid: add region_size parameter · c1084561
      Jonathan Brassow 提交于
      Allow the user to specify the region_size.
      
      Ensures that the supplied value meets md's constraints, viz. the number of
      regions does not exceed 2^21.
      Signed-off-by: NJonathan Brassow <jbrassow@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      c1084561
    • A
      dm raid: tidy includes · 3e8dbb7f
      Alasdair G Kergon 提交于
      A dm target only needs to use include/linux dm headers.
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      3e8dbb7f
    • J
      dm raid: cleanup parameter handling · 13c87583
      Jonathan Brassow 提交于
      Re-order the parameters so they are handled consistently in the same order
      where defined, parsed and output.
      
      Only include rebuild parameters in the STATUSTYPE_TABLE output if they were
      supplied in the original table line.
      
      Correct the parameter count when outputting rebuild: there are two words,
      not one.
      
      Use case-independent checks for keywords (as in other device-mapper targets).
      Signed-off-by: NJonathan Brassow <jbrassow@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      13c87583
  2. 18 4月, 2011 1 次提交
  3. 10 3月, 2011 1 次提交
  4. 14 1月, 2011 1 次提交
    • N
      dm: raid456 basic support · 9d09e663
      NeilBrown 提交于
      This patch is the skeleton for the DM target that will be
      the bridge from DM to MD (initially RAID456 and later RAID1).  It
      provides a way to use device-mapper interfaces to the MD RAID456
      drivers.
      
      As with all device-mapper targets, the nominal public interfaces are the
      constructor (CTR) tables and the status outputs (both STATUSTYPE_INFO
      and STATUSTYPE_TABLE).  The CTR table looks like the following:
      
      1: <s> <l> raid \
      2:	<raid_type> <#raid_params> <raid_params> \
      3:	<#raid_devs> <meta_dev1> <dev1> .. <meta_devN> <devN>
      
      Line 1 contains the standard first three arguments to any device-mapper
      target - the start, length, and target type fields.  The target type in
      this case is "raid".
      
      Line 2 contains the arguments that define the particular raid
      type/personality/level, the required arguments for that raid type, and
      any optional arguments.  Possible raid types include: raid4, raid5_la,
      raid5_ls, raid5_rs, raid6_zr, raid6_nr, and raid6_nc.  (again, raid1 is
      planned for the future.)  The list of required and optional parameters
      is the same for all the current raid types.  The required parameters are
      positional, while the optional parameters are given as key/value pairs.
      The possible parameters are as follows:
       <chunk_size>		Chunk size in sectors.
       [[no]sync]		Force/Prevent RAID initialization
       [rebuild <idx>]	Rebuild the drive indicated by the index
       [daemon_sleep <ms>]	Time between bitmap daemon work to clear bits
       [min_recovery_rate <kB/sec/disk>]	Throttle RAID initialization
       [max_recovery_rate <kB/sec/disk>]	Throttle RAID initialization
       [max_write_behind <value>]		See '-write-behind=' (man mdadm)
       [stripe_cache <sectors>]		Stripe cache size for higher RAIDs
      
      Line 3 contains the list of devices that compose the array in
      metadata/data device pairs.  If the metadata is stored separately, a '-'
      is given for the metadata device position.  If a drive has failed or is
      missing at creation time, a '-' can be given for both the metadata and
      data drives for a given position.
      
      Examples:
      # RAID4 - 4 data drives, 1 parity
      # No metadata devices specified to hold superblock/bitmap info
      # Chunk size of 1MiB
      # (Lines separated for easy reading)
      0 1960893648 raid \
      	raid4 1 2048 \
      	5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81
      
      # RAID4 - 4 data drives, 1 parity (no metadata devices)
      # Chunk size of 1MiB, force RAID initialization,
      #	min recovery rate at 20 kiB/sec/disk
      0 1960893648 raid \
              raid4 4 2048 min_recovery_rate 20 sync\
              5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81
      
      Performing a 'dmsetup table' should display the CTR table used to
      construct the mapping (with possible reordering of optional
      parameters).
      
      Performing a 'dmsetup status' will yield information on the state and
      health of the array.  The output is as follows:
      1: <s> <l> raid \
      2:	<raid_type> <#devices> <1 health char for each dev> <resync_ratio>
      
      Line 1 is standard DM output.  Line 2 is best shown by example:
      	0 1960893648 raid raid4 5 AAAAA 2/490221568
      Here we can see the RAID type is raid4, there are 5 devices - all of
      which are 'A'live, and the array is 2/490221568 complete with recovery.
      
      Cc: linux-raid@vger.kernel.org
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NJonathan Brassow <jbrassow@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      9d09e663