History

md: fix clearing of 'blocked' flag in the presence of bad blocks.

When the 'blocked' flag on a device is cleared while there are unacknowledged bad blocks we must fail the device. This is needed for backwards compatability of the interface. The code currently uses the wrong test for "unacknowledged bad blocks exist". Change it to the right test.

NeilBrown committed 15 years ago

Commit 7da64a01 parent 1b6afa11 file · +1 −1Browse files

Unified · Split

drivers/md/md.c+1−1
@@ -2592,7 +2592,7 @@ state_store(mdk_rdev_t *rdev, const char *buf, size_t len) · 2591 unmodified lines
25922592 err = 0;
25932593 } else if (cmd_match(buf, "-blocked")) {
25942594 if (!test_bit(Faulty, &rdev->flags) &&
2595− test_bit(BlockedBadBlocks, &rdev->flags)) {
2595+ rdev->badblocks.unacked_exist) {
25962596 /* metadata handler doesn't understand badblocks,
25972597 * so we need to fail the device
25982598 */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t