Re: [PATCH] md - 3 of 3 - Don't check a device size before bd_get in md.c

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

 



On 2003-03-13T12:00:10,
   NeilBrown <neilb@cse.unsw.edu.au> said:

> Lars Marowsky-Bree <lmb@suse.de> noted that we shouldn't
> be using blk_size for a device before calling bd_get.
> This code rearrangement fixes this little issue.
> 
> 
>  ----------- Diffstat output ------------
>  ./drivers/md/md.c |   15 ++++++++-------
>  1 files changed, 8 insertions(+), 7 deletions(-)
> 
> diff ./drivers/md/md.c~current~ ./drivers/md/md.c
> --- ./drivers/md/md.c~current~	2003-03-13 10:47:13.000000000 +1100
> +++ ./drivers/md/md.c	2003-03-13 11:46:25.000000000 +1100
> @@ -2395,13 +2395,6 @@ static int hot_add_disk(mddev_t * mddev,
>  	}
>  
>  	persistent = !mddev->sb->not_persistent;
> -	size = calc_dev_size(dev, mddev, persistent);
> -
> -	if (size < mddev->sb->size) {
> -		printk(KERN_WARNING "md%d: disk size %d blocks < array size %d\n",
> -				mdidx(mddev), size, mddev->sb->size);
> -		return -ENOSPC;
> -	}
>  
>  	rdev = find_rdev(mddev, dev);
>  	if (rdev)
> @@ -2423,6 +2416,14 @@ static int hot_add_disk(mddev_t * mddev,
>  		err = -EINVAL;
>  		goto abort_export;
>  	}
> +	size = calc_dev_size(dev, mddev, persistent);
> +
> +	if (size < mddev->sb->size) {
> +		printk(KERN_WARNING "md%d: disk size %d blocks < array size %d\n",
> +				mdidx(mddev), size, mddev->sb->size);
> +		err = -ENOSPC;
> +		gotot abort_export;

Hi Neil, the patch seems to have gotten mangled here, I'm reasonably sure
"gotot" won't compile at least ;-)


Sincerely,
    Lars Marowsky-Brée <lmb@suse.de>

-- 
Principal Squirrel 
SuSE Labs - Research & Development, SuSE Linux AG
  
"If anything can go wrong, it will." "Chance favors the prepared (mind)."
  -- Capt. Edward A. Murphy            -- Louis Pasteur
-
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