Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 230657
b: refs/heads/master
c: ba1b41b
h: refs/heads/master
i:
  230655: 09898ce
v: v3
  • Loading branch information
NeilBrown committed Jan 13, 2011
1 parent 8e24064 commit b8cd0e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 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: 1a940fcee31ec6c18c2f24dbdad31d54e4c35048
refs/heads/master: ba1b41b6b4e30cb66ae2775faadea05cae3ce61c
7 changes: 6 additions & 1 deletion trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -2479,6 +2479,10 @@ slot_store(mdk_rdev_t *rdev, const char *buf, size_t len)
if (rdev2->raid_disk == slot)
return -EEXIST;

if (slot >= rdev->mddev->raid_disks &&
slot >= rdev->mddev->raid_disks + rdev->mddev->delta_disks)
return -ENOSPC;

rdev->raid_disk = slot;
if (test_bit(In_sync, &rdev->flags))
rdev->saved_raid_disk = slot;
Expand All @@ -2496,7 +2500,8 @@ slot_store(mdk_rdev_t *rdev, const char *buf, size_t len)
/* failure here is OK */;
/* don't wakeup anyone, leave that to userspace. */
} else {
if (slot >= rdev->mddev->raid_disks)
if (slot >= rdev->mddev->raid_disks &&
slot >= rdev->mddev->raid_disks + rdev->mddev->delta_disks)
return -ENOSPC;
rdev->raid_disk = slot;
/* assume it is working */
Expand Down

0 comments on commit b8cd0e6

Please sign in to comment.