aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/md.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 9e3ce432e37e..3b5cd4ef54f1 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1984,7 +1984,7 @@ offset_store(mdk_rdev_t *rdev, const char *buf, size_t len)
1984 unsigned long long offset = simple_strtoull(buf, &e, 10); 1984 unsigned long long offset = simple_strtoull(buf, &e, 10);
1985 if (e==buf || (*e && *e != '\n')) 1985 if (e==buf || (*e && *e != '\n'))
1986 return -EINVAL; 1986 return -EINVAL;
1987 if (rdev->mddev->pers) 1987 if (rdev->mddev->pers && rdev->raid_disk >= 0)
1988 return -EBUSY; 1988 return -EBUSY;
1989 if (rdev->size && rdev->mddev->external) 1989 if (rdev->size && rdev->mddev->external)
1990 /* Must set offset before size, so overlap checks 1990 /* Must set offset before size, so overlap checks
@@ -2023,7 +2023,7 @@ rdev_size_store(mdk_rdev_t *rdev, const char *buf, size_t len)
2023 2023
2024 if (e==buf || (*e && *e != '\n')) 2024 if (e==buf || (*e && *e != '\n'))
2025 return -EINVAL; 2025 return -EINVAL;
2026 if (my_mddev->pers) 2026 if (my_mddev->pers && rdev->raid_disk >= 0)
2027 return -EBUSY; 2027 return -EBUSY;
2028 rdev->size = size; 2028 rdev->size = size;
2029 if (size > oldsize && rdev->mddev->external) { 2029 if (size > oldsize && rdev->mddev->external) {