+ md-simplify-checking-of-available-size-when-resizing-an-array.patch added to -mm tree

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

 



The patch titled
     md: simplify checking of available size when resizing an array
has been added to the -mm tree.  Its filename is
     md-simplify-checking-of-available-size-when-resizing-an-array.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: md: simplify checking of available size when resizing an array
From: NeilBrown <neilb@xxxxxxx>

When "mdadm --grow --size=xxx" is used to resize an array (use more or less of
each device), we check the new siza against the available space in each
device.

We already have that number recorded in rdev->size, so calculating it is
pointless (and wrong in one obscure case).

Signed-off-by: Neil Brown <neilb@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/md/md.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff -puN drivers/md/md.c~md-simplify-checking-of-available-size-when-resizing-an-array drivers/md/md.c
--- a/drivers/md/md.c~md-simplify-checking-of-available-size-when-resizing-an-array
+++ a/drivers/md/md.c
@@ -4045,11 +4045,8 @@ static int update_size(mddev_t *mddev, u
 		return -EBUSY;
 	ITERATE_RDEV(mddev,rdev,tmp) {
 		sector_t avail;
-		if (rdev->sb_offset > rdev->data_offset)
-			avail = (rdev->sb_offset*2) - rdev->data_offset;
-		else
-			avail = get_capacity(rdev->bdev->bd_disk)
-				- rdev->data_offset;
+		avail = rdev->size * 2;
+
 		if (fit && (size == 0 || size > avail/2))
 			size = avail/2;
 		if (avail < ((sector_t)size << 1))
_

Patches currently in -mm which might be from neilb@xxxxxxx are

origin.patch
md-fix-calculation-of-degraded-for-multipath-and-raid10.patch
md-add-another-compat_ioctl-for-md.patch
md-endian-annotation-for-v1-superblock-access.patch
md-endian-annotations-for-the-bitmap-superblock.patch
md-fix-bug-where-spares-dont-always-get-rebuilt-properly-when-they-become-live.patch
md-simplify-checking-of-available-size-when-resizing-an-array.patch
md-fix-up-maintenance-of-degraded-in-multipath.patch
md-fix-printk-format-warnings-seen-on-powerpc64.patch
lockdep-annotate-nfs-nfsd-in-kernel-sockets.patch
lockdep-annotate-nfs-nfsd-in-kernel-sockets-tidy.patch
remove-lock_key-approach-to-managing-nested-bd_mutex-locks.patch
simplify-some-aspects-of-bd_mutex-nesting.patch
use-mutex_lock_nested-for-bd_mutex-to-avoid-lockdep-warning.patch
avoid-lockdep-warning-in-md.patch
lockdep-annotate-nfsd4-recover-code.patch
md-conditionalize-some-code.patch
md-dm-reduce-stack-usage-with-stacked-block-devices.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux