linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Andy Smith <andy@strugglers.net>
Cc: linux-raid@vger.kernel.org
Subject: Re: Shrinking number of devices on a RAID-10 (near 2) array
Date: Fri, 29 Aug 2014 13:53:12 +1000	[thread overview]
Message-ID: <20140829135312.5a6e78bc@notabene.brown> (raw)
In-Reply-To: <20140825113402.GF19874@bitfolk.com>

[-- Attachment #1: Type: text/plain, Size: 2229 bytes --]

On Mon, 25 Aug 2014 11:34:03 +0000 Andy Smith <andy@strugglers.net> wrote:

> Hi Neil,
> 
> On Mon, Aug 25, 2014 at 09:26:14PM +1000, NeilBrown wrote:
> > What does "mdadm --examine" on one of the devices report now that it is v1.0?
> > 
> > Particularly interested in the "Unused Space :" line.
> 
> /dev/sda3:
>           Magic : a92b4efc
>         Version : 1.0
>     Feature Map : 0x0
>      Array UUID : 3905b303:ca604b72:be5949c4:ab051b7a
>            Name : 2
>   Creation Time : Sun Jun  4 08:18:59 2006
>      Raid Level : raid10
>    Raid Devices : 6
> 
>  Avail Dev Size : 618726528 (295.03 GiB 316.79 GB)
>      Array Size : 928089792 (885.10 GiB 950.36 GB)
>    Super Offset : 618727392 sectors
>    Unused Space : before=0 sectors, after=864 sectors
>           State : active
>     Device UUID : e30176be:81a57e84:1f2aa206:9515150f
> 
>     Update Time : Sun Aug 24 14:29:15 2014
>        Checksum : bd599c72 - correct
>          Events : 1
> 
>          Layout : near=2
>      Chunk Size : 64K
> 
>    Device Role : Active device 5
>    Array State : AAAAAA ('A' == active, '.' == missing, 'R' == replacing)
> 
> All other devices report same (apart from UUID/checksum/role).

'after=864' should be plenty.

mdadm writes '128' to 'new_offset'
This is bigger than 'data_offset' (which must be zero, or it would have been
reported), mddev->dev_sectors is 618726528 while rdev->sectors is 618727392
(difference is 864), so 
		if (new_offset - rdev->data_offset
		    + mddev->dev_sectors > rdev->sectors)
cannot return 'true'.  Yet it seems that it does.

Ahh.. somewhere else returns -E2BIG:

	if (mddev->pers && mddev->persistent &&
	    !super_types[mddev->major_version]
	    .allow_new_offset(rdev, new_offset))
		return -E2BIG;

But super_1_allow_new_offset always succeeds if new_offset >
rdev->data_offset, so that cannot be the problem.


I know.  rdev->sectors isn't "Super Offset", it is only "Avail Dev Size".
You need to
  echo 618727392 > /sys/block/md2/md/dev-sda3/size
and same for the other devices.

I looks like I need to get mdadm to be more clever when it gets -E2BIG.
Can you check that the above works?

Thanks,
NeilBrown


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  parent reply	other threads:[~2014-08-29  3:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-23 16:31 Shrinking number of devices on a RAID-10 (near 2) array Andy Smith
2014-08-24  3:09 ` NeilBrown
2014-08-24  6:28   ` Craig Curtin
2014-08-24  6:45     ` NeilBrown
2014-08-24 13:19       ` Andy Smith
2014-08-24 14:39   ` Andy Smith
2014-08-25 10:32     ` Andy Smith
2014-08-25 11:26       ` NeilBrown
2014-08-25 11:34         ` Andy Smith
2014-08-28  9:53           ` Andy Smith
2014-08-29  3:53           ` NeilBrown [this message]
2014-08-29  4:02             ` Andy Smith
2014-08-29  4:18               ` NeilBrown
2014-08-29  4:26                 ` Andy Smith
2014-08-29  4:35                   ` NeilBrown
2014-08-29  4:42                     ` Andy Smith
2014-08-29  6:04                       ` NeilBrown
2014-08-29 20:45                         ` Andy Smith
2014-08-29 20:47   ` [PATCH 1/1] Grow: Report when grow needs metadata update Andy Smith
2014-09-03  3:28     ` NeilBrown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140829135312.5a6e78bc@notabene.brown \
    --to=neilb@suse.de \
    --cc=andy@strugglers.net \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).