Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30385
b: refs/heads/master
c: f655675
h: refs/heads/master
i:
  30383: 3ae1dcb
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Jun 26, 2006
1 parent d924cd3 commit 27ef25e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a94213b1fa7b26dcc271bf4b4f9eebf1f1af33a2
refs/heads/master: f655675b3fe09c4d0506d357527fe07544623009
5 changes: 5 additions & 0 deletions trunk/Documentation/md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,18 @@ Each directory contains:
faulty - device has been kicked from active use due to
a detected fault
in_sync - device is a fully in-sync member of the array
writemostly - device will only be subject to read
requests if there are no other options.
This applies only to raid1 arrays.
spare - device is working, but not a full member.
This includes spares that are in the process
of being recoverred to
This list make grow in future.
This can be written to.
Writing "faulty" simulates a failure on the device.
Writing "remove" removes the device from the array.
Writing "writemostly" sets the writemostly flag.
Writing "-writemostly" clears the writemostly flag.

errors
An approximate count of read errors that have been detected on
Expand Down
12 changes: 12 additions & 0 deletions trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -1737,6 +1737,10 @@ state_show(mdk_rdev_t *rdev, char *page)
len += sprintf(page+len, "%sin_sync",sep);
sep = ",";
}
if (test_bit(WriteMostly, &rdev->flags)) {
len += sprintf(page+len, "%swrite_mostly",sep);
sep = ",";
}
if (!test_bit(Faulty, &rdev->flags) &&
!test_bit(In_sync, &rdev->flags)) {
len += sprintf(page+len, "%sspare", sep);
Expand All @@ -1751,6 +1755,8 @@ state_store(mdk_rdev_t *rdev, const char *buf, size_t len)
/* can write
* faulty - simulates and error
* remove - disconnects the device
* writemostly - sets write_mostly
* -writemostly - clears write_mostly
*/
int err = -EINVAL;
if (cmd_match(buf, "faulty") && rdev->mddev->pers) {
Expand All @@ -1766,6 +1772,12 @@ state_store(mdk_rdev_t *rdev, const char *buf, size_t len)
md_new_event(mddev);
err = 0;
}
} else if (cmd_match(buf, "writemostly")) {
set_bit(WriteMostly, &rdev->flags);
err = 0;
} else if (cmd_match(buf, "-writemostly")) {
clear_bit(WriteMostly, &rdev->flags);
err = 0;
}
return err ? err : len;
}
Expand Down

0 comments on commit 27ef25e

Please sign in to comment.