aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/md.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 0a3a4bdcd4af..7d8c2bb0a67c 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2106,8 +2106,6 @@ rdev_size_store(mdk_rdev_t *rdev, const char *buf, size_t len)
2106 2106
2107 if (strict_strtoull(buf, 10, &size) < 0) 2107 if (strict_strtoull(buf, 10, &size) < 0)
2108 return -EINVAL; 2108 return -EINVAL;
2109 if (size < my_mddev->size)
2110 return -EINVAL;
2111 if (my_mddev->pers && rdev->raid_disk >= 0) { 2109 if (my_mddev->pers && rdev->raid_disk >= 0) {
2112 if (my_mddev->persistent) { 2110 if (my_mddev->persistent) {
2113 size = super_types[my_mddev->major_version]. 2111 size = super_types[my_mddev->major_version].
@@ -2118,9 +2116,9 @@ rdev_size_store(mdk_rdev_t *rdev, const char *buf, size_t len)
2118 size = (rdev->bdev->bd_inode->i_size >> 10); 2116 size = (rdev->bdev->bd_inode->i_size >> 10);
2119 size -= rdev->data_offset/2; 2117 size -= rdev->data_offset/2;
2120 } 2118 }
2121 if (size < my_mddev->size)
2122 return -EINVAL; /* component must fit device */
2123 } 2119 }
2120 if (size < my_mddev->size)
2121 return -EINVAL; /* component must fit device */
2124 2122
2125 rdev->size = size; 2123 rdev->size = size;
2126 if (size > oldsize && my_mddev->external) { 2124 if (size > oldsize && my_mddev->external) {