浏览代码

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.

Signed-off-by: NeilBrown <neilb@suse.de>
NeilBrown 14 年之前
父节点
当前提交
7da64a0abc
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/md/md.c

+ 1 - 1
drivers/md/md.c

@@ -2592,7 +2592,7 @@ state_store(mdk_rdev_t *rdev, const char *buf, size_t len)
 		err = 0;
 		err = 0;
 	} else if (cmd_match(buf, "-blocked")) {
 	} else if (cmd_match(buf, "-blocked")) {
 		if (!test_bit(Faulty, &rdev->flags) &&
 		if (!test_bit(Faulty, &rdev->flags) &&
-		    test_bit(BlockedBadBlocks, &rdev->flags)) {
+		    rdev->badblocks.unacked_exist) {
 			/* metadata handler doesn't understand badblocks,
 			/* metadata handler doesn't understand badblocks,
 			 * so we need to fail the device
 			 * so we need to fail the device
 			 */
 			 */