Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115090
b: refs/heads/master
c: 4bbf377
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown committed Oct 13, 2008
1 parent a9c92d2 commit 9819041
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d710e13812600037a723a673dc5c96a071de98d3
refs/heads/master: 4bbf3771ca40d0aaec8316d0e7476b16010288e5
7 changes: 1 addition & 6 deletions trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -3520,17 +3520,12 @@ static int do_md_run(mddev_t * mddev)
return -EINVAL;
}
/*
* chunk-size has to be a power of 2 and multiples of PAGE_SIZE
* chunk-size has to be a power of 2
*/
if ( (1 << ffz(~chunk_size)) != chunk_size) {
printk(KERN_ERR "chunk_size of %d not valid\n", chunk_size);
return -EINVAL;
}
if (chunk_size < PAGE_SIZE) {
printk(KERN_ERR "too small chunk_size: %d < %ld\n",
chunk_size, PAGE_SIZE);
return -EINVAL;
}

/* devices must have minimum size of one chunk */
rdev_for_each(rdev, tmp, mddev) {
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -2028,8 +2028,9 @@ static int run(mddev_t *mddev)
int nc, fc, fo;
sector_t stride, size;

if (mddev->chunk_size == 0) {
printk(KERN_ERR "md/raid10: non-zero chunk size required.\n");
if (mddev->chunk_size < PAGE_SIZE) {
printk(KERN_ERR "md/raid10: chunk size must be "
"at least PAGE_SIZE(%ld).\n", PAGE_SIZE);
return -EINVAL;
}

Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -4007,6 +4007,13 @@ static int run(mddev_t *mddev)
return -EIO;
}

if (mddev->chunk_size < PAGE_SIZE) {
printk(KERN_ERR "md/raid5: chunk_size must be at least "
"PAGE_SIZE but %d < %ld\n",
mddev->chunk_size, PAGE_SIZE);
return -EINVAL;
}

if (mddev->reshape_position != MaxSector) {
/* Check that we can continue the reshape.
* Currently only disks can change, it must
Expand Down

0 comments on commit 9819041

Please sign in to comment.