Skip to content

Commit ab5a98b

Browse files
GuoqingJiangshligit
authored andcommitted
md-cluster: change array_sectors and update size are not supported
Currently, some features are not supported yet, such as change array_sectors and update size, so return EINVAL for them and listed it in document. Reviewed-by: NeilBrown <neilb@suse.com> Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: Shaohua Li <shli@fb.com>
1 parent 1535212 commit ab5a98b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Documentation/md-cluster.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,3 +316,9 @@ The algorithm is:
316316
nodes are using the raid which is achieved by lock all bitmap
317317
locks within the cluster, and also those locks are unlocked
318318
accordingly.
319+
320+
7. Unsupported features
321+
322+
There are somethings which are not supported by cluster MD yet.
323+
324+
- update size and change array_sectors.

drivers/md/md.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4817,6 +4817,10 @@ array_size_store(struct mddev *mddev, const char *buf, size_t len)
48174817
if (err)
48184818
return err;
48194819

4820+
/* cluster raid doesn't support change array_sectors */
4821+
if (mddev_is_clustered(mddev))
4822+
return -EINVAL;
4823+
48204824
if (strncmp(buf, "default", 7) == 0) {
48214825
if (mddev->pers)
48224826
sectors = mddev->pers->size(mddev, 0, 0);
@@ -6438,6 +6442,10 @@ static int update_size(struct mddev *mddev, sector_t num_sectors)
64386442
int rv;
64396443
int fit = (num_sectors == 0);
64406444

6445+
/* cluster raid doesn't support update size */
6446+
if (mddev_is_clustered(mddev))
6447+
return -EINVAL;
6448+
64416449
if (mddev->pers->resize == NULL)
64426450
return -EINVAL;
64436451
/* The "num_sectors" is the number of sectors of each device that

0 commit comments

Comments
 (0)