If there is IO error in log device, don't export it like other raid disks. Otherwise we get kernel crash in different places since rdev->bdev, rdev->mddev becomes NULL Signed-off-by: Shaohua Li <shli@xxxxxx> --- drivers/md/md.c | 4 ++-- drivers/md/raid5.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index c643c9a..ec6574d 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -2523,7 +2523,7 @@ state_store(struct md_rdev *rdev, const char *buf, size_t len) else err = -EBUSY; } else if (cmd_match(buf, "remove")) { - if (rdev->raid_disk >= 0) + if (rdev->raid_disk >= 0 || test_bit(Journal, &rdev->flags)) err = -EBUSY; else { struct mddev *mddev = rdev->mddev; @@ -6044,7 +6044,7 @@ static int hot_remove_disk(struct mddev *mddev, dev_t dev) clear_bit(Blocked, &rdev->flags); remove_and_add_spares(mddev, rdev); - if (rdev->raid_disk >= 0) + if (rdev->raid_disk >= 0 || test_bit(Journal, &rdev->flags)) goto busy; if (mddev_is_clustered(mddev)) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 216fa3c..c164501 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -7128,6 +7128,8 @@ static int raid5_remove_disk(struct mddev *mddev, struct md_rdev *rdev) struct disk_info *p = conf->disks + number; print_raid5_conf(conf); + if (test_bit(Journal, &rdev->flags)) + return -EBUSY; if (rdev == p->rdev) rdevp = &p->rdev; else if (rdev == p->replacement) -- 2.4.6 -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html