1. 21 Jul, 2008 2 commits
    • Andre Noll's avatar
      md: Fix check for overlapping devices. · d07bd3bc
      Andre Noll authored
      The checks in overlaps() expect all parameters either in block-based
      or sector-based quantities. However, its single caller passes two
      rdev->data_offset arguments as well as two rdev->size arguments, the
      former being sector counts while the latter are measured in 1K blocks.
      
      This could cause rdev_size_store() to accept an invalid size from user
      space. Fix it by passing only sector-based quantities to overlaps().
      Signed-off-by: default avatarAndre Noll <maan@systemlinux.org>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      d07bd3bc
    • Neil Brown's avatar
      md: Tidy up rdev_size_store a bit: · d7027458
      Neil Brown authored
       - used strict_strtoull in place of simple_strtoull
       - use my_mddev in place of rdev->mddev (they have the same value)
      and more significantly,
       - don't adjust mddev->size to fit, rather reject changes which make
         rdev->size smaller than mddev->size
      
      Adjusting mddev->size is a hangover from bind_rdev_to_array which
      does a similar thing.  But it really is a better design to insist that
      mddev->size is set as required, then the rdev->sizes are set to allow
      for that.  The previous way invites confusion.
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      d7027458
  2. 11 Jul, 2008 13 commits
  3. 10 Jul, 2008 25 commits