Re: [PATCH] md: fix device size calculation with non-persistent superblock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday February 23, Paul.Clements@SteelEye.com wrote:
> Neil,
> 
> Currently, the device size calculation is not correct when hot-adding
> devices to arrays with non-persistent superblocks. Device size is always
> calculated as if there were a physical superblock on every device. The
> attached simple change to hot_add_disk() fixes the problem.


Hmm.. I had always assumed that non-persistent superblocks only worked
for linear and raid0.  I'm not sure I would trust any other
configuration.

Are you seriously using raid1 with non-persistent superblocks?  How do
you ensure reliable re-assembly after a device failure followed by
shutdown?

NeilBrown

> 
> Thanks,
> Paul--- 2_6_3_rc2/drivers/md/md.c.PRISTINE	Mon Feb 23 11:01:57 2004
> +++ 2_6_3_rc2/drivers/md/md.c	Mon Feb 23 11:29:10 2004
> @@ -2365,7 +2365,12 @@ static int hot_add_disk(mddev_t * mddev,
>  		return -EINVAL;
>  	}
>  
> -	rdev->sb_offset = calc_dev_sboffset(rdev->bdev);
> +	if (mddev->persistent)
> +		rdev->sb_offset = calc_dev_sboffset(rdev->bdev);
> +	else
> +		rdev->sb_offset = rdev->bdev->bd_inode->i_size
> +							>> BLOCK_SIZE_BITS;
> +
>  	size = calc_dev_size(rdev, mddev->chunk_size);
>  	rdev->size = size;
>  
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux